django-planet

Blog: Screaming At My Screen

web http://www.screamingatmyscreen.com/feed/
Author

KISS Beats Accidental Complexity

Oct. 8, 2024 » Screaming At My Screen » [Archived Version]

Our friends at Sanvira published a blog post about a Django project they shipped five years ago, which is still running today without change, hand holding or application server restart. I really enjoy stories like this. Small, well engineered monoliths, just sitting there doing their job and not randomly breaking. While this sounds trivial it is not – and it is by far not the standard. I have seen enough systems fall apart for random reasons. Missing database indexes being on top of the list. T…

Read More

Safely rewriting complex code

Feb. 29, 2024 » Screaming At My Screen » [Archived Version]

There is a lot of advice out there suggesting to never rewrite anything. Just improve it in small increments. This is sound advice for services, modules or large chunks of code. Yet sometimes rewriting a complex part of your system will be inevitable. This does not mean the above advice does not apply. You still want to minimise risk and potentially try to ship smaller increments instead of rewriting 2000 lines of code in one go. No matter how big you deside to make the change, some guardrails …

Read More

Django Build To Last

April 8, 2023 » Screaming At My Screen » [Archived Version]

Tim does an amazing job applying "Build to Last" principles to Django. Community and reliability are two of the three most important reasons making me enjoy Django for a very long time (documentation being the third). I think it is healthy for any project to know what its distinguishing attributes are, as well as having a plan for where the project will go the next few years. And while I agree with Tim, I want to add a bit more to the big hairy audacious list of goals to take into consideration…

Read More

Upgrading Django Projects - Introduction

March 20, 2023 » Screaming At My Screen » [Archived Version]

One questions I am asked quite often is how to upgrade larger projects to a newer Django release. While upgrading to a newer minor release is usually really easy and does not require much work it can become a bit harder upgrading to a new major release. My oldest project points back to 0.9x, so it has seen some upgrades, and there are certain patters that proved to work pretty well. Upgrading a Django project is not harder or easier than upgrading any other project of the same size which is u…

Read More

Individual member of the Django Software Foundation

March 20, 2023 » Screaming At My Screen » [Archived Version]

Last Saturday, somewhen late at night when we came back home from our trip to the city, I received an unexpected mail. I was nominated, seconded and approved to be an Individual Member of the Django Software Foundation. This came completely unexpected and honestly caught me a bit off guard. I let it sink in a bit and accepted the invitation on Sunday, with a nice glass of scotch next to me. I have been using Django since 0.96-svn or so and I have been using it to ship production software for …

Read More

Managing state in Django models

March 20, 2023 » Screaming At My Screen » [Archived Version]

A Django model often will contain some form of state. And there will most likely be events which modify the state. While those two things are not always called like this, the concept still exists. More often than not you will find a view controller assigning the new state to an instance of a model when certain conditions are met. In some cases you will see the event code being abstracted to make it easier to test, maybe in a separate function or class, maybe to a model method. And more often th…

Read More

Adding two factor authentication to Django admin

March 20, 2023 » Screaming At My Screen » [Archived Version]

As my dissatisfaction with WordPress grew, I did the only Reasonable Thing(tm) and decided to roll out my own CMS again. Which means I do not only have the joy of building a tool exactly fitting my needs, but I also have to build some of the functionality I would expect every production-ready system to provide. Account security in Django's contrib.auth and contrib.admin package did not change a lot over the last decade, but in 2020 I expect some basic functionality from every system, like two f…

Read More

Thoughts on „Surviving Django“

March 20, 2023 » Screaming At My Screen » [Archived Version]

Daniele, the author of psycopg2, wrote an interesting post about Django and its migration system. Having used Django for well over a decade and having worked on projects either handed to me or greenfield at different scales I cannot agree with his arguments as they are stated. The migration and ORM system does solve a far larger problem than allowing web apps to switch between databases. Djangos migration system is primarily a developer tool. A rather excellent one I cannot praise enough. It a…

Read More

Deep dive: Django Q and SQS

March 20, 2023 » Screaming At My Screen » [Archived Version]

When working on a Django application the de facto recommendation for a task queue is Celery. I believe this is a good recommendation. It is kind of like buying IBM - “no one was ever fired for buying IBM”. I started using Django Q more recently and it is doing a great job. One system I built using it processes roughly 400k tasks per day. Surely not the largest system and surely not the most impressive number, but decent enough to say that Django Q is a solid choice. But as with many smaller pr…

Read More

Deploying Django at small scale

March 20, 2023 » Screaming At My Screen » [Archived Version]

It feels like common knowledge and an accepted fact that you want to run PostgreSQL in production. And have some sort of load balancer to be able to scale your application server horizontally. Throw in Redis for caching and you have the most generic web application stack I can come up with. At scale this makes a ton of sense. It is a battle tested stack, that will most likely not fail you and if it does, there are tons of resources on how to fix it. Those are a lot of moving parts you want to k…

Read More