Blog: Anže’s Blog

Speeding Up Django Startup Times with Lazy Imports

March 22, 2026 » Anže’s Blog » [Archived Version]

At Fancer we are building the security suite for startups. Startups use a lot of SaaS tools and services which means we are building a lot of integrations. Most of these go through API calls but we also try to leverage SDKs to make our lives a little bit easier. The problem we started noticing was that loading all these 3rd party integrations has made our Django app feel very sluggish. While this was noticeable around deployments and starting scans, it hurt the most during local development. It…

Read More

Typing Your Django Project in 2026

March 12, 2026 » Anže’s Blog » [Archived Version]

The first version of Django was released about 10 years before Python standardized its type hints syntax. Because of this it’s not surprising that getting type hints to work in your Django project is not going to be trivial. django-stubs with mypy If you want your Django codebase to be type checked then django-stubs is the go to package to use. It ships both type-stubs for most of Django’s public APIs as well as a mypy plugin that fills in the typing information for all the dynamic black magic …

Read More

Django bulk_update memory issue

Oct. 12, 2025 » Anže’s Blog » [Archived Version]

Recently, I had to write a Django migration to update hundreds of thousands of database objects. With some paper-napkin math I calculated that I can fit all the necessary data in memory, making the migration much simpler than it would have been otherwise.

Read More

Django bulk_update memory issue

Oct. 12, 2025 » Anže’s Blog » [Archived Version]

Recently, I had to write a Django migration to update hundreds of thousands of database objects. Loading the data With some paper-napkin math I calculated that I can fit all the necessary data in memory, making the migration much simpler than it would have been otherwise. First I had to make sure to load only the necessary columns. Django’s only queryset method came in very handy: objs_to_update = TheObject.objects.only("id", "field1", "field2", "field3").all() Because I generally don’t trust m…

Read More

Migrating Gunicorn to Granian

Sept. 27, 2025 » Anže’s Blog » [Archived Version]

I migrated one of my Django apps from Gunicorn to Granian yesterday. Here is how the migration went and some of my thoughts on Granian and Gunicorn.

Read More

Migrating Gunicorn to Granian

Sept. 27, 2025 » Anže’s Blog » [Archived Version]

I migrated one of my Django apps from Gunicorn to Granian yesterday. Here is how the migration went and some of my thoughts on Granian and Gunicorn. Migration This is the second time I attempted to try out Granian. The first time I got blocked because Granian didn’t support unix sockets. I run several Django apps on the same host behind Nginx, and I’m using Unix sockets for communication between Nginx and Gunicorn. I could have switched to using ports, but I didn’t want to mess with Nginx for t…

Read More

Disable runserver warning in Django 5.2

June 24, 2025 » Anže’s Blog » [Archived Version]

Django 5.2 added a new warning that shows up when you start your development server with python manage.py runserver:

Read More

Disable runserver warning in Django 5.2

June 24, 2025 » Anže’s Blog » [Archived Version]

Django 5.2 added a new warning that shows up when you start your development server with python manage.py runserver: WARNING: This is a development server. Do not use it in a production setting. Use a production WSGI or ASGI server instead. For more information on production servers see: https://docs.djangoproject.com/en/5.2/howto/deployment/ Here is how it looks like in the terminal: The warning is helpful for newcomers because Django’s development server is neither secure nor performant enou…

Read More

UV with Django

Aug. 29, 2024 » Anže’s Blog » [Archived Version]

Using UV to manage dependencies of your Django application.

Read More

UV with Django

Aug. 29, 2024 » Anže’s Blog » [Archived Version]

Using UV to manage dependencies of your Django application.

Read More