Django
6 posts
Dual-purpose URLconf
When introducing some generic behaviour into my application, I like to separate that behaviour in some way from the remaining application code to prevent application specifics from leaking into the …
Read moreShould Neapolitan support URL Namespaces?
Yes, but the first designs reached for in #16 would introduce Neapolitan-machinery that duplicates Django primitives. Ouch. There’s a smaller change that avoids it… Many people shy away …
Read moreConditional Redaction in Django Templates
Today I needed to redact names of users and some other sensitive strings from a significant part of a Django application. After starting to litter template code with {% if allow_unredacted %}...{% …
Read moreTricking Django's title Filter
Django’s title filter is often used to prettify strings in templates, for example, when rendering model verbose names in an admin or API interface. When handling abbreviations it can be a bit …
Read moreTesting Django Migrations with PostgreSQL and Foreign Keys
The incredibly helpful blogpost Writing Unit Tests for Django Migrations delivers what the title promises. Making testing of migrations.RunPython feasible and easy … as long as you don’t …
Read moreClean Django Storage Backend Configuration
TIL: You are able to pass arbitrary configuration values via the OPTIONS key to Django storage backends. They are passed as keyword arguments to the __init__ method of the storage backend. That fact …
Read more