Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django: find ghost tables without associated models
Heavy refactoring of models can leave a Django project with “ghost tables”, which were created for a model that was removed without any trace in the migration history. Thankfully, by using some Django internals, you can find such tables. Use the database introspection methods table_names() to list all tables and django_table_names() to list tables associated with models. By casting these to sets, you can subtract the latter from the former to find tables not associated with a model: In [1]: from django.db import connection In [2]: table_names = set(connection.introspection.table_names()) In [3]: django_table_names = set(connection.introspection.django_table_names()) In [4]: table_names - django_table_names - {"django_migrations"} Out[4]: {'sweetshop_humbug', 'sweetshop_jellybean', 'sweetshop_marshmallow'} Note the django_migrations table needs excluding. This is Django’s internal table for tracking migrations, which has no associated (permanent) model. From here, you’ll want to make a judgement call on what to do with the tables. Perhaps should have models and others can be removed. If a ghost table has no useful data or migration references, consider dropping it directly with SQL, rather than adding a migration. This can be done with dbshell. For example, using PostgreSQL: $ ./manage.py dbshell psql (...) Type "help" for help. candy=# DROP TABLE sweetshop_humbug; DROP TABLE Fin May your … -
Weeknotes (2024 week 47)
Weeknotes (2024 week 47) I missed a single co-writing session and of course that lead to four weeks of no posts at all to the blog. Oh well. Debugging I want to share a few debugging stories from the last weeks. Pillow 11 and Django’s get_image_dimensions The goal of django-imagefield was to deeply verify that Django and Pillow are able to work with uploaded files; some files can be loaded, their dimensions can be inspected, but problems happen later when Pillow actually tries resizing or filtering files. Because of this django-imagefield does more work when images are added to the system instead of working around it later. (Django doesn’t do this on purpose because doing all this work up-front could be considered a DoS factor.) In the last weeks I suddenly got recurring errors from saved files again, something which shouldn’t happen, but obviously did. Django wants to read image dimensions when accessing or saving image files (by the way, always use height_field and width_field, otherwise Django will open and inspect image files even when you’re only loading Django models from the database…!) and it uses a smart and wonderful1 hack to do this: It reads a few hundred bytes … -
Introducing DjangoVer
Version numbering is hard, and there are lots of popular schemes out there for how to do it. Today I want to talk about a system I’ve settled on for my own Django-related packages, and which I’m calling “DjangoVer”, because it ties the version number of a Django-related package to the latest Django version that package supports. But one quick note to start with: this is not really “introducing” the idea of DjangoVer, because I know I’ve used the name a few times already in other places. I’m also not the person who invented this, and I don’t know for certain who did — I’ve seen several packages which appear to follow some form of DjangoVer and took inspiration from them in defining my own take on it. Django’s version scheme: an overview The basic idea of DjangoVer is that the version number of a Django-related package should tell you which version of Django you can use it with. Which probably doesn’t help much if you don’t know how Django releases are numbered, so let’s start there. In brief: Django issues a “feature release” — one which introduces new features — roughly once every eight months. The current feature release series of Django is 5.1. … -
Django-related Deals for Black Friday 2024
Here are some Django-related deals for this year’s Black Friday (29th November) and Cyber Monday (1st December), including my own. I’ll keep this post up to date with any new deals I learn about. If you are also a creator, email me with details of your offer and I’ll add it here. For more general developer-related deals, see BlackFridayDeals.dev. My books My three books have a 50% discount, for both individual and team licenses, until the end of Cyber Monday (1st December). This deal stacks with the purchasing power parity discount for those in lower-income countries. Buy now: Boost Your Django DX - $21 instead of $42 (freshly updated!) Boost Your Git DX - $19.50 instead of $39 Speed Up Your Django Tests - $24.50 instead of $49 Aidas Bendoraitis’ paid packages Aidas Bendoraitis of djangotricks.com has created two paid packages. Use the links below for a 20% discount, available until the end of the 1st December. Django GDPR Cookie Consent - a customizable, self-hosted cookie consent screen. This package takes the pain out of setting up legally-mandated cookie banners and settings, without using an expensive or inflexible vendor. Buy it on Gumroad Django Paddle Subscriptions - an integration with … -
Boost Your Django DX updated again
I have just released the second update to Boost Your Django DX, my book of developer experience (DX) recommendations for Django projects. This update contains a new chapter, changes some recommended tools, and upgrades to Python 3.13 and Django 5.1. Overall, the book is 45 pages longer, now totalling 326! The most significant new addition is a chapter on debuggers: Python’s built-in one, pdb, and IPython’s enhanced version, ipdb. The chapter introduces pdb with realistic examples, covers all the essential commands, and includes many tips, like using the .pdbrc configuration file. Another major change is swapping the recommended CSS and JavaScript tools from ESLint and Prettier to Biome. Biome is a super-fast formatter and linter for CSS, JavaScript, JSON, TypeScript, and more. The new section introduces it and provides integration advice for Django projects. Thank you to everyone who has supported the book so far. Just the other day, it reached fifty five-star reviews. I am very grateful for all the feedback from the community and aim to keep improving the book. This update is free for all who previously purchased the book. To help readers catch up, the introduction chapter has a changelog with links to the updated sections, … -
How to migrate your Poetry project to uv
So, like me you’ve decided to switch from Poetry to uv, and now you’re wondering how to actually migrate your pyproject.toml file? You’ve come to the right place! -
Thoughts on my election as a DSF board member
My thoughts on my election as a member of the Django Software Foundation (DSF) board of directors. -
Rename uploaded files to ASCII charset in Django
Telling Django to rename all uploaded files in ASCII encoding is easy and takes only two steps. -
Django site permissions
-
Django comparison grid
-
Django-simpleadmindoc updated
create documentation for django website -
Extending different base template for ajax requests in Django
-
Django-sites-ext
-
Django app name translation in admin
"Django app name translation in admin" is small drop-in django application that overrides few admin templates thus allowing app names in Django admin to be translated. -
Django import export
Importing and exporting data with included admin integration. -
Django cookie consent application
django-cookie-consent is a reusable application for managing various cookies and visitors consent for their use in Django project. -
Building docker images with private python packages
Installing private python packages into Docker container can be tricky because container does not have access to private repositories and you do not want to leave trace of private ssh key in docker… -
Django News - DjangoCon Europe 2025 in Dublin, Ireland! 🍀 - Nov 15th 2024
News Announcing DjangoCon Europe 2025 in Dublin, Ireland! 🍀 DjangoCon Europe will be held in Dublin, Ireland, from April 23rd to 27th, 2025. djangoproject.com Django’s technical governance challenges, and opportunities Two of the four existing members of the Django Software Foundation Steering Council just stepped down to trigger a new election earlier than otherwise scheduled. djangoproject.com Welcoming Vinit Kumar as the Newest django CMS Fellow Django CMS just announced its second Fellow, Vinit Kumar, who joins the existing fellow since 2022, Fabian Braun. django-cms.org Updates to Django Today 'Updates to Django' is presented by Velda Kiara from Djangonaut Space! Last week we had 17 pull requests merged into Django by 11 different contributors - including 1 first-time contributor! Congratulations to David Winiecki for having their first commits merged into Django - welcome on board! Coming in Django 5.2, django.contrib.admindocs will now support custom link text in docstrings, making the documentation more user-friendly. Topics in Django forum that would appreciate your contribution are: Retiring django-users and django-developers mailing lists Migrating off of Trac Django Newsletter Wagtail CMS Wagtail: Should we remove our upper version boundary on Django? The Wagtail team is debating whether to remove or further relax the upper version … -
Heroku To DigitalOcean - Building SaaS #206
In this episode, I began a migration of my JourneyInbox app from Heroku to DigitalOcean. The first step to this move, since I’m going to use Kamal, is to put the app into a Docker image. We got the whole app into the Docker image, then cleaned up local development and the CI system after making changes that broke those configurations. -
Django for the Meat Industry - Bryton Wishart
Cured ComplicanceArticlesCured Compliance on nbn Australiadjango-two-factor-authSponsorsThe Stack Report - Carlton's Monthly Premium NewsletterLearnDjango.com - Free Tutorials and Premium Courses -
Free digital security checkups for people/organizations concerned about the incoming US government
If you — as an individual or a group — are re-assessing your digital security posture in light of the US election results, I’m available to help. I’m offering free digital security check-ups to anyone who feels like they need it now. -
Django News - Django bugfix release issued: 5.1.3 - Nov 8th 2024
News Django bugfix release issued: 5.1.3 The Django 5.1.3 update fixes three bugs in 5.1.2 and adds compatibility with Python 3.13. djangoproject.com Notice of breaking changes for GitHub Actions PSA: On December 5, 2024, the ubuntu-latest label will change from ubuntu 22 to ubuntu 24, which is expected to break things. You will want to test or change your labels proactively to avoid breaking things. github.blog PyCon US 2025 Kicks Off: Website, CfP, and Sponsorship Now Open! The PyCon US 2025 conference website, Call for Proposals, and sponsorship program are open! blogspot.com Updates to Django Today's 'Updates to Django' is presented by Abigail Afi Gbadago from Djangonaut Space! Last week we had 19 pull requests merged into Django by 14 different contributors - including 6 first-time contributors!🎉 Congratulations to Anthony Joseph🚀, Johanan Oppong Amoateng🚀, Peter Ruszel, Maria Hynes🚀, Soyoung Kang🚀 and maddrum for having their first commits merged into Django - welcome on board! Coming in Django 5.2 Support has been added for MEMORY/SERIALIZE option to QuerySet.explain() on PostgreSQL 17+ Missing alters_data=True has been added to QuerySet and UserManager methods Django Newsletter Wagtail CMS Level up your image accessibility and dashboards with Wagtail 6.3 Wagtail 6.3 introduces a new ImageBlock … -
Deploy Your Own Web App With Kamal 2
Kamal offers zero-downtime deploys, rolling restarts, asset bridging, remote builds, accessory service management, and everything else you need to deploy and manage your web app in production with Docker. Originally built for Rails apps, Kamal will work with any type of web app that can be containerized. We dig into Kamal, how it works, and how you could use it on your next project. -
Avoid Counting in Django Pagination
This article looks at how to avoid the count query in Django's paginator. -
Three Django wishes
<p>’Tis the season when people are posting their “Django wishlists”, for specific technical or organizational or community initiatives they’d like to see undertaken. Here are a few&nbsp;examples:</p> <ul> <li><a href="https://gist.github.com/sarahboyce/68ffaaeae24d2501cf27a914f77fb97c">Sarah&nbsp;Boyce</a></li> <li><a href="https://www.better-simple.com">Tim&nbsp;Schilling</a></li> <li><a href="https://softwarecrafts.co.uk/100-words/day-203">Andy&nbsp;Miller</a></li> <li><a href="https://emma.has-a.blog/articles/django-wishlist-explained.html">Emma&nbsp;Delescolle</a></li> </ul> <p>So, in the spirit of the season, here is my own list, which I’ve narrowed down to three wishes (in the tradition of many stories about wishes), consisting of one organizational item and two technical&nbsp;ones.</p> <h3>Pass the&nbsp;torch</h3> <p>This one requires a bit of background, so please bear with&nbsp;me.</p> <p><a href="https://www.djangoproject.com/foundation/">The Django Software Foundation</a> — usually just abbreviated “<span class="caps">DSF</span>” — is the nonprofit organization which officially “owns” Django. It’s the legal holder of all the intellectual property, including both the copyright to the original Django codebase (generously donated by the Lawrence Journal-World, where it was first developed) and the trademarks, such as the registered trademark on the name “Django” itself. The <span class="caps">DSF</span> does a lot (and could do more, with a bigger budget) to support the Django community, and offers financial support to the development of Django itself, but does <em>not</em> directly develop Django, or oversee Django’s development or technical&nbsp;direction.</p> <p>Originally, that job went to Django co-creators Adrian Holovaty and Jacob Kaplan-Moss. …