Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django News - 400 DSF Members - Jan 31st 2025
News PyPI Now Supports Project Archival Projects on PyPI can now be marked as archived. pypi.org Django Software Foundation 400 individual members of the Django Software Foundation The Django Software Foundation reached 400 individual members. thib.me Updates to Django Today 'Updates to Django' is presented by Abigail Afi Gbadago from Djangonaut Space! Last week we had 21 pull requests merged into Django by 12 different contributors - including 2 first-time contributors! Congratulations to Gregory Mariani and Igor Scheller for having their first commits merged into Django - welcome on board!🎊 Highlights of the changes made: The main branch is now tracking development for Django 6.0. You can now squash a squashed migration. This eases the squashing process (#19082). Support has been dropped for Python 3.10 & 3.11 (#19067) Django Newsletter Wagtail CMS Our updated Accessibility Conformance Report Wagtail has released a new Accessibility Conformance Report for version 6.3, showcasing improvements across WCAG 2.2 criteria, detailing compliance in the CMS, documentation, and websites, and inviting feedback for further accessibility enhancements. wagtail.org Sponsored Link 1 Hiring Jr. Web Services Engineer This position is for someone who can bring their python software development experience to support Playdate, Game Publishing, and our Apps! You … -
Finishing Simple Signup - Building SaaS #213
In this episode, I completed the simplified sign up process for my JourneyInbox app. I finished off the final features that add account verification and initial engagement features to make sign up and nice and functional experience. -
Weeknotes (2025 week 05)
Weeknotes (2025 week 05) Djangonaut Space In December I wrote a few paragraphs about my decision to not run for the Django Steering Council, mentioning that I want to contribute in different ways. I have offered to contribute to Djangonaut Space to do some mentoring. I’m already a bit stressed, but that’s normal and to be expected. I’ll probably have more to share about that in the close future! Releases feincms-cookiecontrol 1.6: Removed the hardcoded dependency upon feincms3 and some additional code golfing. The cookie banner JavaScript is now back to <4KiB. django-curtains 0.7: Updated the CI job list and modernized the package somewhat, no code changes necessary. It’s good to release updated versions though just to show that it’s still actively maintained. django-prose-editor 0.10.3: Small CSS fixes and mainly updated TipTap/ProseMirror. django-imagefield 0.22: The updated version no longer autodeletes processed images; this wasn’t really a problem before but I was a little bit fearful that images are still referenced elsewhere and this change let’s me sleep better. feincms-oembed 2.0: Oembed support for FeinCMS 1 without actually depending upon the FeinCMS package itself. Still works. django-content-editor 7.2: The Region type is now hashable; this may be useful, or not. feincms3 … -
Thinking About Risk: Sidebar #4: Quantitative Risk Revisited
In part 1 of this series, I briefly covered quantitive risk measuring – assigning a numeric value to risk, like “$3,500”, rather than a qualitative label like “medium” – only to quickly recommend against trying it. In this final sidebar, I want to come back to this topic. I’ll spend a bit more time explaining what I see as the pros and cons of quantitative risk measurement – why you might or might not want to use numeric values over more simple risk matrixes. -
Python Leiden (NL) meetup: fawltydeps - Johan Herland
(One of my summaries of the Python Leiden (NL) meetup in Leiden, NL). FawltyDeps is a python dependency checker. "Finding undeclared and unused dependencies in your notebooks and projects". Note by Reinout: since 2009 I'm one of the maintainers of z3c.dependencychecker.... also a python dependency checker :-) So this talk interested me a lot, as I didn't know yet about fawltydeps. A big problem in science is the "replication crisis". Lots of research cannot actually be reproduced when you try it... Data science is part of this problem. Reproducing your jupyter notebook for instance. Someone looked at 22k+ jupyter notebooks. Only 70% had declared their dependencies, 46% could actually install the dependencies and only 5% actually could be run. ModuleNotFoundError and ImportError were the number 1 and 3 in the list of exceptions! What is a dependency? For instance "numpy", if you have a import numpy as np in your file. Numpy isn't in the python standard library, you have to install it first. You can specify dependencies in setup.py, pyproject.toml, requirements.txt and so. If you import something and don't specify it, it is an "undeclared dependency". When you later on remove an import and don't adjust your requirements.txt, you … -
Python Leiden (NL) meetup: python in applied mathematics - Tobias Datema
(One of my summaries of the first Python Leiden (NL) meetup in Leiden, NL). Tobias studied applied mathematics at Delft University. One of the fields he used python for was graph theory. A graph consists of points ("vertices") connected by lines ("edges"). It is a large field with many real world projects like social networks and logistics. He showed a demo he made with networkx, a python library that makes it real easy to do these kinds of graph calculations. Graphs need to be shown. He used pyviz for that by converting the networkx graph to the format understood by pyviz. Another field is machine learning. He did an experiment with a simulated self-driving car. He used a library that handles the basics like "reacting to a closed line on the road" and "measuring the distance to the dashed line on the road". The simulation is shown in a visual form, which makes it funny to look at. In his study, python was also handy for statistics and numerical analysis. -
How to Use GraphQL in Django with Elasticsearch
When you need to use GraphQL with Django, a common practice is to use Graphene-Django, which allows you to query Django models. However, directly querying Django models might be too slow, especially when you have many complex relations. To speed that up, you can add one more layer of abstraction and index your Django models to an Elasticsearch server. In this article, I will show you how to create a GraphQL interface for querying posts from the Elasticsearch server. Elasticsearch Server The easiest way to install the Elasticsearch server locally is using EVM - Elasticsearch Version Manager: $ sudo curl -o /usr/local/bin/evm https://raw.githubusercontent.com/duydo/evm/master/evm $ sudo chmod +x /usr/local/bin/evm Then you can install Elasticsearch 7.17.27 (or other version) with EVM, as follows: $ evm install 7.17.27 By default, the Elasticsearch server will raise a warning if you don't have HTTPS or basic authentication. You can change one setting to turn off those warnings for localhost. To do so, add a line to ~/.evm/elasticsearch-7.17.27/config/elasticsearch.yml: xpack.security.enabled: false Now, you can start the server with: $ evm start If you need more Elasticsearch versions on the same computer, you can easily install and switch between them. Python Packages Install the latest packages of Django … -
Looking at Django task runners and queues
I use django-apscheduler to run a queue of scheduled tasks. Now I also need the ability to run one-off tasks and that turned out to not be so simple. -
Django News - Django 5.2 alpha 1 release - Jan 24th 2025
News Django 5.2 alpha 1 released Django 5.2 alpha 1 is now available. It represents the first stage in the 5.2 release cycle and is an opportunity for you to try out the changes coming in Django 5.2. djangoproject.com Hello from the new Steering Council; and a quick temporary voting process change The Steering Council is officially in action, and we want to give you a heads-up on a change we're making for the short term. djangoproject.com Djangonaut Space - New session 2025 Djangonaut Space is holding a fourth session! This session will start on February 17th, 2025. Applications are open until January 29th, 2025, Anywhere on Earth. djangoproject.com Tailwind CSS v4.0 - Tailwind CSS Tailwind CSS v4.0 is out — an all-new version of the framework optimized for performance and flexibility, with a reimagined configuration and customization experience, and taking full advantage of the latest advancements the web offers. tailwindcss.com Django Software Foundation President of the Django Software Foundation Notes from the Thibaud Colas, the new President of the Django Software Foundation. thib.me Updates to Django Today 'Updates to Django' is presented by Velda Kiara from Djangonaut Space! Last week we had 26 pull requests merged into Django by … -
Strip spaces
When I joined TriOptima back in 2010, a common pattern emerged where names of things were slightly off because of stray whitespaces. Sometimes we had duplicates like "foo", "foo " and " foo" in the database. Sometimes we couldn’t find stuff in logs because you searched for "foo was deleted", when actually you had to search for "foo was deleted" (notice the double space!). Sorting was “broken” because " foo" and "foobar" are not next to each other. And more issues that I can’t remember… It was everywhere, causing problems across the entire code base. Each individual issue was easily fixed by cleaning up the data, but it added up to an annoying support burden. My fix at the time was to make a function that took a Django Form instance and returned a new instance with space stripping on all fields. Something like: form = auto_strip(Form(...)) After I added that to every single Django form in the entire code base that slow and steady trickle of bugs and annoyances just stopped. From seeing a few a month consistently to zero for the next ~9 years. Even better: I never got a complaint about it. This was fixed in Django … -
Beyond Golden Pathways - Teaching Django with Sheena O’Connell
Sheena's Personal SitePreludeGuild of EducatorsDjangoCon US Keynote - Power to the People who Teach the PeoplePyCon Italia Keynote - A Tale from the TrenchesEscape conf - Testing Python Web Apps using PlaywrightWebinar: Why HTMX makes good business senseUsing Cursor to Port Django tests to pytestSponsorThis episode was brought to you by Buttondown, the easiest way to start, send, and grow your email newsletter. New customers can save 50% off their first year with Buttondown using the coupon code DJANGO. -
Django admin tip: Adding links to related objects in change forms
Django admin tip: Adding links to related objects in change forms Any issue which came up on the Django Forum and Discord is how to add links to other objects to the Django administration interface. It’s something I’m doing often and I want to share the pattern I’m using. It’s definitely not rocket science and there are probably better ways to do it, but this one works well for me. Method 1: Override the change form template In one project users can be the editor of exactly one organization. The link between organizations and users is achieved using a Editor model with a ForeignKey(Organization) and a OneToOneField(User). I wanted to add a link to the organization page at the bottom of the user form. An easy way to achieve this is to add a template at templates/admin/auth/user/change_form.html (or something similar if you’re using a custom user model): {% extends "admin/change_form.html" %} {% block after_related_objects %} {{ block.super }} {% if original.editor %} <fieldset class="module aligned"> <h2>Organization</h2> <div class="form-row"> <a href="{% url 'admin:organizations_organization_change' original.editor.organization.pk %}">{{ original.editor.organization }}</a> </div> </fieldset> {% endif %} {% endblock after_related_objects %} The original context variable contains the object being edited. The editor attribute is the reverse … -
Django News - Django 5.1.5 security release - Jan 17th 2025
News Django security releases issued: 5.1.5, 5.0.11, and 4.2.18 Several new security updates. As ever, you should endeavor to be on the latest version of Django for security reasons. djangoproject.com Django 5.2 alpha 1 released Django 5.2 alpha 1 is now available. It represents the first stage in the 5.2 release cycle and is an opportunity for you to try out the changes coming in Django 5.2. djangoproject.com Python Insider: Python 3.14.0 alpha 4 is out Python 3.14 is still in development. This release, 3.14.0a4, is the fourth of seven planned alpha releases. python.org Djangonaut Space Session 4 Applications Open! Djangonaut Space Applications are open now and close on January 29th, 2025 AOE. djangonaut.space Django Software Foundation Hello from the new Steering Council; and a quick temporary voting process change An update on the voting process to move faster on the smaller things the SC currently has in from of them. djangoproject.com Updates to Django Today 'Updates to Django' is presented by Velda Kiara from Djangonaut Space! Last week we had 20 pull requests merged into Django by 12 different contributors 🎊! Highlights of the changes made: The contrib.postgres aggregates ordering argument has been deprecated in favor of order_by. URLField … -
Thinking About Risk: Sidebar #3: Two Flavors of Medium Risk
When you look at a likelihood/impact risk matrix, you might notice that “medium” appears twice – once as high-likelihood/low-impact, and once as low-likelihood/high-impact. These two “mediums” aren’t at all the same! -
Building SaaS with Python and Django #212.2
In this episode, we continued on the sign up workflow simplification. The focus of this stream was on adding the background task that will send the magic link email to allow sign in. This is the second half of the stream because my internet cut out. -
Signin Email - Building SaaS #212.1
In this episode, we continued on the sign up workflow simplification. The focus of this stream was on adding the background task that will send the magic link email to allow sign in. -
Built with Django Newsletter - 2025 Week 3
Hey, Happy Thursday! Why are you getting this: *You signed up to receive this newsletter on Built with Django. I promised to send you the latest projects and jobs on the site as well as any other interesting Django content I encountered during the month. If you don't want to receive this newsletter, feel free to unsubscribe anytime. News and Updates Happy New Year! Hope the first 16 days of 2025 have been good to you! Hope this year will be the best one for you so far! I haven't been to proactive with Built with Django updates unfortunately. So much has been going on with personal life and work that it left very small amount of time for side projects. Starting to pick up the pace fortunately, will see what will be coming. If you have any requests/ideas for the website, please let me know! What I'm hoping to do in the coming months is up the number of posts on the blog, and hopefully start doing some video tutorials. Sponsors This issue is sponsored by SEO Blog Bot. Well, sponsor is a strong word. It is just another project of mine that I wanted to share with you … -
Thinking About Risk: Sidebar #2: The Swiss Cheese Model
In the real world, accidents happen when a series of small missteps align to create severe consequences. This is something we call the “Swiss Cheese Model”: imagining a systems failure as a set of “holes” in our layers of defense that all line up to create a series accident. -
New upcoming Dutch python meetup: Leiden (NL)
Important things first: 27 January there's a python meetup in Leiden (NL) of the new python Leiden user group. Meetup groups come and go, often depending on one or two people or on a company that organises it. And yes, meetup.com has basically cornered the market, at least in my experience. There used to be a "PUN", python usergroup Nederland, meeting that would be held in various cities, depending on the company that hosted it in turn. (For those in NL: Den Haag, Zoetermeer, Rotterdam, Utrecht, Veenendaal, Arnhem, Amsterdam, ...). Managed via a mailinglist, as meetup.com didn't exist yet. Later lots of python and/or django meetup.com-based-meetups were organised. To me, it felt a bit weird that all of them seemed to be city-oriented. Amsterdam python meetup (3 different ones), Amsterdam django meetup, Utrecht (2x), Eindhoven, Rotterdam. I went to many of them, mostly it is just an hour of travel by public transport :-) I like going to those meetups. You get a feel for what people are doing with python. You get ideas. You learn about libaries (sometimes even from the standard library) that you didn't know about. New python tricks. For me, it is a great method to … -
Database Indexing in Django
This article explores the basics of database indexing, its advantages and disadvantages, and how to apply it in a Django application. -
Weeknotes (2025 week 03)
Weeknotes (2025 week 03) Claude AI helped me for the first time django-imagefield prefers processing thumbnails, cropped images etc. directly when saving the model and not later on demand; it’s faster and also you’ll know it immediately when an image couldn’t be processed for some reason instead of only later when people actually try browsing your site. A consequence is that if you change formats you have to remember that you have to reprocess the images. The Django app comes with a management command ./manage.py process_imagefields to help with this. I have added parallel processing based on concurrent.futures to it some time ago so that the command completes faster when it is being run on a system with several cores. A work colleague is using macOS (many are, in fact), and he always got multiprocessing Python crashes. This is a well known issue and I remember reading about it a few years ago. I checked the docs and saw that the concurrent.futures page doesn’t mention macOS, but multiprocessing does. So, I hoped that a simple rewrite of the management command using multiprocessing might fix it. Because I was in a rush and really didn’t want to do it I turned … -
Thinking About Risk: Sidebar #1: "Exposure"
Risk is usually defined as the product of two factors: Likelihood and Impact. However, some disciplines include a third factor: Exposure. What’s that about, and when is it useful? -
Don’t automate screenshots, automate iframes
There’s a lot of tools out there to automate taking screenshots for documentation of web apps/libraries. Screenshots are certainly sometimes a good idea, but they have some serious downsides: As you’re sending pixels instead of text, screen readers don’t work Screenshots adjust badly to zoom levels Responsive layouts don’t work Automatic dark mode selection doesn’t work They are larger to download They are hard to generate They are slow to generate When writing the iommi documentation I realized that I can bypass all that by using embedded iframes instead of screenshots. Instead of spinning up a headless Chrome, writing playwright/selenium automation and suffering through all that, I can render the page I am documenting like normal, and save the html to disk, which is then linked to with an iframe. It required some custom tooling, but check out the iommi cookbook for examples and I think you’ll agree the results are pretty great. Here’s a sample test from the cookbook that generates the iframe, and then the rST file for the docs: def test_how_do_you_turn_off_pagination(small_discography): # language=rst """ How do you turn off pagination? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Specify `page_size=None`: """ table = Table( auto__model=Album, page_size=None, ) # @test show_output(table) # @end The show_output … -
Migrating from Hyde to Hugo
Almost twelve years after the last big site infrastructure change, it’s time for another round. This time is purely technical, with no intentional visual changes. Motivation I haven’t posted in a long time, and this blog had largely faded into the background for me. I was doing some management of my domains, trying to clean things up after my domains registered with Google were transferred to Squarespace. As part of this, I decided to use Cloudfare as my nameserver, which I’ve used for other projects. I started reading about Cloudfare Pages, which seemed like a great match for easily deploying a statically-generated site. You can point Cloudflare to a GitHub repo, and it will automatically kick off a build after every commit, and deploy the static artifacts. Unfortunately, the Hyde framework I was using is no longer maintained, and still does not support Python 3. Cloudflare Pages does not have support for Python 2.7. So I decided it would be a fun project to migrate to a new static site generator. Finding a new tool Searching around, I quickly settled on Hugo due to its large community, and reputation for blazing fast speed. I wasn’t quite sure how the easy … -
Creating Open Graph Images in Django for Improved Social Media Sharing
Although social media algorithms usually discourage posting links so that users stay as long as possible on the network, people often still post links below an introductory post as a comment or reply. Normal links to websites on social media look pretty dull unless you add open-graph images representing that link. In this article, I will show you how you can generate open-graph images for a Django website using web rendering from HTML and CSS. I rely on this technique to generate Open Graph previews for links from DjangoTricks, 1st things 1st, and PyBazaar. What is an Open Graph? Facebook created the Open Graph protocol to allow websites to provide rich representation of any web page. Although it has specifics for websites, articles, profiles, music, and video, the common use case is to have a preview image with a title for social feeds. Open Graph previews work with most well-known social networks, including Facebook, Threads, LinkedIn, Mastodon, and Blue Sky. Open Graph tags are HTML meta tags that you put in the HEAD section, e.g.: <meta property="og:type" content="website" /> <meta property="og:url" content="{{ WEBSITE_URL }}{{ request.path }}" /> <meta property="og:title" content="{{ profile.user.get_full_name }}" /> {% if profile.open_graph_image %} <meta property="og:image" content="{{ …