Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
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
-
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