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 … -
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. -
Django News - Django Girls Turns 10 - Nov 1st 2024
News 2025 DSF Board Candidates There are 21 individuals who have chosen to stand for election, and here is a complete list including their candidate statements. Voting closes on November 15, 2024, at 23:59 Anywhere on Earth. djangoproject.com Django Girls Blog — It's our 10th birthday! Django Girls has turned 10! We’re so proud to reach this momentous milestone and of everything the community has achieved! During the past decade, 2467 volunteers in 109 countries have run 1137 free workshops. More than 24,500 women in 593 cities have attended our events, and for many of them, Django Girls was their first step towards a career in tech. The results speak for themselves. djangogirls.org Octoverse: AI leads Python to top language as the number of global developers surges In this year’s Octoverse report, Python overtook JavaScript as the most popular language on GitHub. github.blog PSF Fellow Nominations Q4 Due Date PSF Fellow nominations for Q4 2024 are open until November 20th—nominate someone whose contributions to the Python community deserve recognition. jonafato.com Updates to Django Today's 'Updates to Django' is presented by Abigail Afi Gbadago from Djangonaut Space! Last week we had 21 pull requests merged into Django by 15 different contributors … -
Python Core Developer - Mariatta Wijaya
Mariatta’s personal site Mariatta on GitHub, Fosstodon, Instagram, and LinkedIn GitHub stories Hidden Figures of Python podcast CMDLines Python discussion forumSponsorThe Stack Report - Carlton's Monthly Premium Newsletter