Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Weeknotes (2024 week 49)
Weeknotes (2024 week 49) Django Steering Council elections I have been thinking long and hard about running for the Django Steering Council. I think there are a few things I could contribute since I’ve been using Django for 16 or more years, and have been working on, maintaining and publishing third-party apps almost all this time. I have also contributed a few small features to Django core itself, and contributed my fair share of tests and bugfixes. The reason why I haven’t been more involved was always that I feared the review process with what I perceive to be a too unrestrained perfectionism. Teaching people is good, but I fear that those who teach are self-selected survivors of the process, which come to appreciate the perfectionism a bit too much. It’s somewhat the same as with the Swiss naturalization process – the hurdles are very high, and some of those who weather the process maybe are or grow to be too fond of it. An important point is that this has nothing to do with being nice (or not). Everybody has always been great, maybe with the exception of myself back when I didn’t understand that the problem wasn’t the … -
Django News - Django security releases issued: 5.1.4, 5.0.10, and 4.2.17 - Dec 6th 2024
News Django security releases issued: 5.1.4, 5.0.10, and 4.2.17 Django 5.1.4 fixes one security issue with severity “high”, one security issue with severity “moderate”, and several bugs in 5.1.3. djangoproject.com Python 3.13.1, 3.12.8, 3.11.11, 3.10.16 and 3.9.21 are now available Another big release day! Python 3.13.1 and 3.12.8 were regularly scheduled releases, but they do contain a few security fixes. That makes it a nice time to release the security-fix-only versions too, so everything is as secure as we can make it. blogspot.com A new home for python-build-standalone Astral is taking stewardship of python-build-standalone, Gregory Szorc's foundational project for installing portable Python distributions. astral.sh Django Software Foundation Help us make it happen ❤️ And just like that, 2024 is almost over! If your finances allow, donate to the Django Software Foundation to support the long-term future of Django. djangoproject.com Updates to Django Add support for multi-column primary keys A 19-year-old ticket just got accepted! djangoproject.com Today 'Updates to Django' is presented by Velda Kiara from Djangonaut Space! Last week we had 20 pull requests merged into Django by 15 different contributors - including 3 first-time contributors! Congratulations to Tommy Allen, Ayush Khatri , and Brock Smickley for having their first … -
Finding Blocks Across a Wagtail Site
Discover how to efficiently locate and update specific blocks across your Wagtail site, even when they're deeply nested. -
Django: launch pdb when a given SQL query runs
Here’s another technique for using pdb within Django. I will add this to the new debugging chapter of Boost Your Django DX in a future update. When debugging Django code, you might need to start with a given SQL query and work backwards to find the code that triggered it. This can be surprisingly hard because the ORM doesn’t neatly map to SQL, and the laziness of QuerySets means queries can run far from where they were created. One way to go from a query to the triggering code is to use database instrumentation. This allows you to write middleware-like functions for SQL queries. In this case, we’ll use that capability to detect when specific queries run and open the debugger. (I’ve blogged about database instrumentation before, on backporting a Django ORM feature and always-installed instrumentation.) Below is a context manager that temporarily installs a database instrumentation function. That function opens the debugger with breakpoint() for any query that looks like a SELECT on the example_book table. from contextlib import contextmanager from django.db import connection @contextmanager def breakpoint_on_target_query(): def instrument(execute, sql, params, many, context): if sql.startswith("SELECT") and 'FROM "example_book"' in sql: breakpoint() return execute(sql, params, many, context) with connection.execute_wrapper(instrument): yield … -
Rebuilding django-prose-editor from the ground up
Rebuilding django-prose-editor from the ground up The django-prose-editor package provides a HTML editor based upon the ProseMirror toolkit for the Django administration interface and for the frontend. The package has been extracted from a customer project and open sourced so that it could be used in other projects as well. It followed a very restricted view of how rich text editors should work, which I have initially added to the FeinCMS repository when documenting the design decisions more than 15 years ago (Note that I didn’t edit the paragraph, it’s reproduced here as it was back then, with all the errors and heedlessness.) All of this convinced me that offering the user a rich text editor with too much capabilites is a really bad idea. The rich text editor in FeinCMS only has bold, italic, bullets, link and headlines activated (and the HTML code button, because that’s sort of inevitable – sometimes the rich text editor messes up and you cannot fix it other than going directly into the HTML code. Plus, if someone really knows what he’s doing, I’d still like to give him the power to shot his own foot). My personal views are unchanged. I have to … -
Making Django Ready for the Next 20 Years
Emma Delescolle's candidacy statement for the Django Steering Council. Making Django ready for the next 20 years by: - lowering the barrier to contribution and involving a more diverse set of contributors - dealing with the realities of an aging code-base - building code ownership and groups specializing in specific areas of core - enacting feature requests from the steering council (django roadmap) - improving the third-party package story Read more in the article! -
Thinking About Risk: An introduction to thinking about risk
Welcome to a new series about how to think about risk. This series is a crash course, a high-level introduction to the most important concepts and risk frameworks. It’s intended for people who encounter risk from time to time and need some basic tools, but don’t want to make a deep study of it. My hope is that it’ll help you better analyze risk when it comes up for you, and also make it easier to navigate conversations with risk professionals. -
Django News - 2024 Malcolm Tredinnick Memorial Prize awarded to Rachell Calhoun - Nov 29th 2024
News 2024 Malcolm Tredinnick Memorial Prize awarded to Rachell Calhoun This year's winner is Rachell Calhoun. Read more about her contributions to Django along with those of her follow nominees. djangoproject.com Django 6.x Steering Council Candidate Registration Registration is open for candidates until December 4, 2024. djangoproject.com 🏷️ Python Black Friday & Cyber Monday sales (2024) The seventh annual compilation of Python learning deals compiled by Trey Hunner. treyhunner.com Django Software Foundation Django Developers Survey 2024 The annual Django Developers Survey is now live! It should take you about 10 minutes to complete and provides a wealth of information to the Django team and community on how Django is actually being used. jetbrains.com DjangoCon Europe 2026 call for organizers completed The DjangoCon Europe 2026 call for organizers is now over. We’re elated to report we received three viable proposals, a clear improvement over recent years. djangoproject.com Updates to Django Today's 'Updates to Django' is presented by Abigail Afi Gbadago from Djangonaut Space! Last week we had 10 pull requests merged into Django by 9 different contributors - including a first-time contributor! Congratulations to Caitlin Hogan for having their first commit merged into Django - welcome on board! 🚀 New in … -
Django: launch pdb in templates with a custom {% breakpoint %} tag
In my recent Boost Your Django DX update, I added a new chapter on debuggers. Here’s an extra technique I didn’t finish in time for the update, but I will include it in the next one. Django templates can be hard to debug, especially to figure out which variables are available after several levels of {% extends %} or {% include %} tags. The template engine doesn’t provide a built-in way tag to open the debugger, but adding one is not much work. Below is a custom template tag that starts debugging with breakpoint(). Find this file in resources.zip as debuggers/party-central/example/templatetags/debugging.py. from django import template register = template.Library() @register.simple_tag(name="breakpoint", takes_context=True) def breakpoint_tag(context): exec("breakpoint()", {}, context.flatten()) The tag uses exec() to populate the debugger’s local variables with all variables from the current context. To set up this tag for convenient use: Copy the file as a template tag library called debugging.py. This should be in an app’s templatetags directory, as described in Django’s custom template tag tutorial. For example, if you have an app called core, copy this code to core/templatetags/debugging.py. Add the debugging library to the builtins option in TEMPLATES: TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", "DIRS": [BASE_DIR / "example" … -
Python Tooling - Hynek Schlawack
Hynek’s personal websiteVariomediaHynek on YouTube, Mastodon, and GitHubDjangoCon 2008 Keynote by Cal Henderson: Why I Hate Djangoattrs - Python Classes Without Boilerplatesvcs - A Flexible Service Locator for PythonHynek’s 2011 Review, Ticket 6148 and 373Jacob Kaplan-Moss Thread on extending languagesThe End Of Object Inheritance & The Beginning Of A New ModularityThe Rising SeaDjangoTVSubclassing, Composition, Python, and You - TalkSubclassing in Python ReduxSponsorLearnDjango.com - 50% Black Friday Sale! -
Django: fix a view using a debugger with breakpoint()
This post is an adapted extract from my book Boost Your Django DX, available now with a 50% discount for Black Friday 2024. Python’s breakpoint() function opens its debugger, pdb, which pauses the program and allows you to inspect and modify things. Let’s look at an example of using it within a Django view, from a sample project included in Boost Your Django DX. Here’s what the project looks like: This page, “Party Central”, lists animals with their pizza preferences and whether they’re hungry. Underneath the table are two filter buttons, “Hungry” and “Satiated”, which allow you to select only animals with those hunger levels. Unfortunately, the filter buttons are broken. Click “Hungry” to load http://localhost:8000/?hungry=1 and we see the same list of animals: The hungry URL parameter is there, and the button is highlighted, but the data isn’t filtered. Let’s use pdb to figure out why. We can run pdb with the breakpoint() function, a Python built-in that opens the configured debugger (which is pdb by default). Let’s add it to the view function, before it renders the template. Here’s how the views.py file looks: from django.shortcuts import render from example.models import Animal def index(request): animals = Animal.objects.order_by("name") hungry … -
Creating AI-based Summaries in a Django Website
Summarizing lengthy text can be tedious, especially on platforms like PyBazaar, where concise summaries improve user experience. In this post, I'll share how I used Simplemind and Gemini to automate this process in my Django-based project. Background Info Recently, I launched PyBazaar.com, a website for Python developers to show their skills, find job offers, and post and find development resources. Its purpose is to have a central place where Python developers can market their services, products, or projects. PyBazaar shows lengthy descriptions of career opportunities and resources in the detail views and short summaries in the list views. Summaries help users quickly grasp the content of resources and career opportunities without opening each detailed view, enhancing the overall browsing experience on PyBazaar. To make the editing smoother, I introduced automatic summarization based on AI. Choosing Simplemind for Communication with LLMs Kenneth Reitz, the author of the famous package requests, recently published his newest creation—Simplemind—which improves the developer experience with the APIs of large language models (LLMs). I thought it would be a good opportunity to try integrating his package into PyBazaar. While I chose Google Gemini for its free tier, Simplemind's support for providers like OpenAI or Claude means developers … -
Creating AI-based Summaries in a Django Website
Summarizing lengthy text can be tedious, especially on platforms like PyBazaar, where concise summaries improve user experience. In this post, I'll share how I used Simplemind and Gemini to automate this process in my Django-based project. Background Info Recently, I launched PyBazaar.com, a website for Python developers to show their skills, find job offers, and post and find development resources. Its purpose is to have a central place where Python developers can market their services, products, or projects. PyBazaar shows lengthy descriptions of career opportunities and resources in the detail views and short summaries in the list views. Summaries help users quickly grasp the content of resources and career opportunities without opening each detailed view, enhancing the overall browsing experience on PyBazaar. To make the editing smoother, I introduced automatic summarization based on AI. Choosing Simplemind for Communication with LLMs Kenneth Reitz, the author of the famous package requests, recently published his newest creation—Simplemind—which improves the developer experience with the APIs of large language models (LLMs). I thought it would be a good opportunity to try integrating his package into PyBazaar. While I chose Google Gemini for its free tier, Simplemind's support for providers like OpenAI or Claude means developers … -
Django News - 2025 DSF Board Results - Nov 22nd 2024
News Announcing the 6.x Django Steering Council elections 🚀 The Django Software Foundation has announced early elections for the 6.x Steering Council to address technical governance challenges and guide the project's future direction. djangoproject.com Django Channels 4.2.0 Release Notes Channels 4.2 adds enhanced async support, including improved handling of database connections, compatibility with Django 5.1, and various bug fixes and improvements such as better in-memory channel layer behavior and more robust WebSocket handling. readthedocs.io Python Insider: Python 3.14.0 alpha 2 released Python 3.14.0 alpha 2 introduces features like deferred evaluation of annotations and a new Python configuration C API. blogspot.com Django Software Foundation 2025 DSF Board Election Results The 2025 DSF Board Election results are in, with Abigail Gbadago, Jeff Triplett, Paolo Melchiorre, and Tom Carrick joining the board for two-year terms. djangoproject.com 2024 Django Developers Survey The 2024 Django Developers Survey, is open until December 21st, offering insights into Django usage and a chance to win a $100 gift card for participants providing meaningful answers. djangoproject.com DSF Board monthly meeting, November 19, 2024 Meeting minutes for DSF Board monthly meeting, November 19, 2024 djangoproject.com Updates to Django Today's 'Updates to Django' is presented by Abigail Afi Gbadago from Djangonaut … -
Huey Background Worker - Building SaaS #207
In this episode, I continued a migration of my JourneyInbox app from Heroku to DigitalOcean. I switched how environment configuration is pulled and converted cron jobs to use Huey as a background worker. Then I integrated Kamal configuration and walked through what the config means. -
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