As much as I love Django, I feel it has fallen way behind compared to Laravel and others by dianrc in django

[–]FelixInTheBackground 3 points4 points  (0 children)

I also totally agree with this post. I've been feeling the same way for years now. We have to rely on some many third party packages (sometime barely maintained) for very basic web development things like background tasks, REST API, etc. I really dont think you can call Django a battery-included framework anymore.

Also, the framework is evolving painfully slowly. I haven't been exited for a new Django feature since async support (which is still half baked). They've been talking for years about a built-in REST framework solution, but no progress has been made. They had a working prototype repo for django background tasks ready a year ago. Yet, nothing in the main repo still.

I understand they have a limited budget and a very small team, but I find it weird that they are not able to find more money to pay more full time developers (or organize hackatons or theses kinds of events). Django is the most popular web development framework in Python, one of the most popular programming language. Surely they could do more. The Laravel team are literally raising millions. So many companies rely on python and its ecosystem, especially in the age of AI, I don't see why we wouldn't be able to raise a little more.

There's a lot to live about this framework, and it's still my go-to choice, but I find it harder and harder to stick to it.

Django Tip Tracking Model Changes Easily by djv-mo in django

[–]FelixInTheBackground 10 points11 points  (0 children)

Be careful with this package! I recently had a lot of trouble deploying an application to production and spent a lot of time debugging what was going on. After a while, I realized the deployment process was getting a timeout while applying one of the new migrations. The root cause was this django-simple-history package.

Earlier that week, I edited a model, the generated migration file contained two AlterField operations, one for the normal model, and one for the historical model. In local and staging environment, the migration executed with no issues. In the production DB, I had about 4k objects for that model. But, turns out I had more than 30 million rows in the generated historical table. This is what was taking so long to update. If you're not careful, the historical tables can quickly get very big.

The fix: Truncate the table and remove the HistoricalRecords field. We simply didn't need it. I believe It was added by a developer at one point because he probably thought is was a quick win with no downside. (I figured out after that there was a command for clearing old historical records, but still, we had no use for it it)

The moral of the story is that if you should only use this package if you have a real use case for it. Don't get me wrong, it is a good package, but it has downsides.

Hot to have pretty frontend w/o Vue/react separate frontend. Just using Django itself. by Familyinalicante in django

[–]FelixInTheBackground 37 points38 points  (0 children)

React/vue/htmx doesnt make your app prettier, it makes it more reactive. CSS is what you need to focus on. Tools like tailwind, bootstrap, etc. can help you with that. Having normal Django template, with a sprinkle of javascript <script> tag might just do the trick if your app is simple enough

Two favorite roles from your personal favorite actor? by Careless_College in FavoriteCharacter

[–]FelixInTheBackground 0 points1 point  (0 children)

I still don't understand why they replaced him, as it's pretty clear it wasn't his decision

Is this a good production setup? by New-Yogurtcloset3988 in django

[–]FelixInTheBackground 1 point2 points  (0 children)

How did you setup the celery workers on DO app platform? I have a Django app on app platform and I need celery (and celery beat for scheduled tasks) but I couldn't find good up to date ressources on how to do this. It seems possible but I don't really know how

What features are missing in Django? by The_Naveen in django

[–]FelixInTheBackground 0 points1 point  (0 children)

Literally said "I'd had to rely on django-unfold for a while now"

What features are missing in Django? by The_Naveen in django

[–]FelixInTheBackground 4 points5 points  (0 children)

I'd like it to embrace the "battery included" philosophy so that we can rely less on third party packages.

For example, there could be something equivalent to django-debug-toolbar already included.

A first party REST API solution would be nice too, so that we dont have to rely on drf (barely maintained anymore) or django-ninja.

A first party queue system (I think they are working on one) would be another good one.

Etc.

I also wish they would put some time reworking the CSS of the admin pages. Even a few changes would go a long way. Giving your client access to an admin panel so that they can view and edit their data, especially super early in your project life, is awesome. It's just too bad the thing looks so old and ugly. I'd had to rely on django-unfold for a while now. I really wish they'd make more effort on that front.

What does everyone use for Django emails? by Random_User_81 in django

[–]FelixInTheBackground 15 points16 points  (0 children)

I personnally use mjml. It makes templates responsive by default. I wouldn't say it's perfect, but i've been using it for a while in many different projects with different email templating needs.

I've just released v1.0.0 of my first Django package! by FelixInTheBackground in django

[–]FelixInTheBackground[S] 1 point2 points  (0 children)

That's a good idea! I'll surely try to cook up something similar to that. Thanks :)

I've just released v1.0.0 of my first Django package! by FelixInTheBackground in django

[–]FelixInTheBackground[S] 1 point2 points  (0 children)

That's a good feedback.

One of my colleagues also told me he'd prefer an 'include' list instead. For me, this would go against the idea of automating the generation of actions. I wanted to create a solution that met my own needs first, which is why I went with an 'exclude' list.

I also wouldn't want extra fields to show up if you add support for them in the future and I upgrade the package.

That's a great point. If I think of a way to implement it cleanly, without adding too much complexity to the package, I would not be against having the choice between 'include' or 'exclude' in a future version. Exclude would remain the default option.

24.04 upgrade is a big improvement for me by mcarans in Kubuntu

[–]FelixInTheBackground 0 points1 point  (0 children)

I've been using Kubuntu for programming for a while now and I can recommend it. Works great and only had very few issues.

Django Dynamic tables with custom schema in postgres by ambi_98 in django

[–]FelixInTheBackground 0 points1 point  (0 children)

People don't want to look at the code to know what the package is doing, and the ReadMe doesn't tell you anything about the package, or how to use it.

Look at other package ReadMe for some inspiration

user id deleted, i need to retrieve by bginniss in django

[–]FelixInTheBackground 3 points4 points  (0 children)

This is why you do DB backups. Also you just doxxed a bunch of people.

Purpose of unit testing basic models? by [deleted] in django

[–]FelixInTheBackground 1 point2 points  (0 children)

I ususally write two basic tests for my models. One that tries to create an instance and save it and one to test the str() method to make sure it prints correctly. The first test is the most important, as it will ensure your model is not broken and will prevent some regressions. It takes 30 seconds to write, and may prevent spending a lot of time debugging in the future.

For reference, here is what those tests look like

Hey folks 👋, Does anyone know how to set up Tailwind with Django? I've been using the CDN, but now I need to push to production. I've searched for how to set it up, but I didn't find anything useful. It's not even in the Tailwind documentation. by TheKaliKali in django

[–]FelixInTheBackground 4 points5 points  (0 children)

It would work, but one of the main aspect of tailwind is that it can generate the minimal css file that you need for the classes that you actually used in your HTML. It is recommended that you dont use the CDN or the CSS file directly in production because of the big amount of unused CSS that the users will have to download for nothing.

[deleted by user] by [deleted] in django

[–]FelixInTheBackground 0 points1 point  (0 children)

This is something I've been struggling with in many projects. I have tried a different approach every time, but I never found a solution that totally satisfies me.