Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django News - Django 5.0 alpha 1 released - Sep 22nd 2023
News Django 5.0 alpha 1 released Django 5.0 alpha 1 is now available. It represents the first stage in the 5.0 release cycle and is an opportunity for you to try out the changes coming in Django 5.0. There are many new exciting features, which you can read about in the in-development 5.0 release notes. djangoproject.com Python Release Python 3.12.0rc3 Python 3.12.0rc3 "is the absolutely last release preview" for Python 3.12. python.org Updates to Django There was a big push to get as many PRs as possible in before the 5.0 feature freeze deadline and so last week we had a massive 22 pull requests merged into Django by 13 different contributors - including 7 first time contributors! Congratulations to Rinku Chaudhari, Anvansh, Lemuel Sta Ana, michele, puc_dong, Yves Weissig and Sam Toyer for having their first commits merged into Django - welcome on board! Some of the final features added to 5.0 were: The main admin content area is now rendered in a <main> tag instead of <div> (#34833) and it's header in a <header> tag instead of <div> (#34832) which improves accessibility. Functions decorated with functools.lru_cache can be serialized in migrations without the need to write a custom … -
My fourth appearance on Django Chat
I’ve once more had the pleasure of joining Carlton and Will on the Django Chat podcast, in Episode #146. We spoke on Tuesday, just hours after Django 5.0 alpha 1 was released, on several topics: Favourite features coming in Django 5.0 My new book, Boost Your Git DX, available now in early access. Some Git tips: autocorrect, global ignore files, and tracking a directory with .gitignore. The future of Git. Making an AI version of myself. My “magic wand” feature for the future of Django. Also, there’s a little easter egg: at 43:35 you can hear my baby boy pushing his “twinkle twinkle little star” walker in the background 😂 Listen on the episode page or your favourite podcast consumption channel. Enjoy! —Adam -
Git and Django 5.0 - Adam Johnson
Django 5.0 alpha 1Don’t create .gitkeep filesNew book, Boost Your Git DXSpeed Up Your Django Tests book DjangoCon Europe 2023 | Good form: How Django’s form rendering improved during the 4.x seriesFossil Versus Git Support the ShowLearnDjango.comButtonDjango News -
Keep content managers' admin access up-to-date with role-based permissions
Keep content managers’ Django admin access up-to-date with role-based permissions Django’s built-in permissions system is great if you want fine-grained control of the permissions content managers should have. The allowlist-based approach where users have no permissions by default and must be granted each permission individually makes a lot of sense to me and is easy to understand. When we build a CMS at Feinheit we often use the Django administration panel as a CMS. Unfortunately, Django doesn’t provide a way to specify that content managers should have all permissions in the pages and articles app (just as an example). Adding all current permissions in a particular app is straightforward when using the filter_horizontal interface but keeping the list up-to-date later isn’t. When we add an additional content block plugin we always have to remember to also update the permissions after deploying the change – and often, deployment happens some time after the code has been written, e.g. because clients want to approve the change first. What happens all too often is that the manual step of updating permissions gets forgotten. This has annoyed me (intermittently) for a long time and my preferred solution has always been to give superuser permissions … -
Edgecase 2023: wednesday late morning sessions
(One of my summaries of the 2023 Dutch edgecase k8s conference in Utrecht, NL). Home automation: from scrap to smart - Marcel Claassen He wanted to automate his house. But he didn't want to spend a lot of money. So: lots of second-hand computers, temperature monitors, pumps. The most expensive part was 1000 Euro (new price 3000, so that's OK). Two cheap broken second-hand lawn mower robots that were combinable into one Let's start simple! He had an old analog electricity meter, so he tried to hook up a sensor that looked at the analog meter, but that didn't really work. In 2020 he got a modern smart meter, so he could get cracking. Such a meter has a "P1" port for reading the measurement. He first ran it on a raspberry pi, but in the meantime he's got it running in K3S. A problem was that the container needed full host access to read out the serial port. The solution: a separate "serial2network" proxy that makes the serial data available over the network. Handy! Next up: garden lighting. First a simple sensor + remotely operated switch. Battery life was an issue, as was water resistance and sensor degredation... His … -
Edgecase 2023: home automation with an elevator
(One of my summaries of the 2023 Dutch edgecase k8s conference in Utrecht, NL). A nice talk by Erwin de Keijzer. Full title: do you need to take general relativity into consideration when measuring your elevator?. Erwin has an elevator inside his, otherwise quite normal, house. An old lady used to live there and she needed an elevator to get around the house. The elevator is real slow, but handy for moving heavy stuff around. He wanted to do some automation around it... Some rules/goals: Know where the elevator is Add music when the elevator is moving Play announcements when the elevator stops at a floor Don't break the elevator Don't mess with the internal electronics. His first attemt was to use a cheap ultrasonic sensor. The lift shaft was too high, though. And it sometimes picked up the support beams instead of the lift. He now uses the sensor for his standing desk. Attempt 2: "TF Luna LiDAR". A raspberry pi is connected to it and uses NATS and some Go code to write the measurements to prometheus. With the position handled, he moved to alerting. Stuck between floors (you have to keep pushing the button to move), moving … -
Edgecase 2023: wednesday early morning sessions
(One of my summaries of the 2023 Dutch edgecase k8s conference in Utrecht, NL). The truth about kubernetes - Gerrit Tamboer He's one of the founders of Fullstaq (the conference organisers). They started with aws/azure/etc. Working for everything from Around 2019, hybrid cloud became popular. Part in the regular cloud, part in your own datacenter. For that you need it to be reasonably similar on both sides. Now, edge computing is on the rise. Internet of things, CDN edge locations, all sorts of things. A big help for them was K3S. But the core that makes it all possible: gitops (argocd, flux, etc). 2023: kubernetes was released in 2014. So nine years. What's coming up in the near future? We're maturing and lots of cool things are happening. But... for almost all companies, that maturity isn't actually true. Some cloud-only companies that recently started might use kubernetes to the full, but most are slowly transitioning. Common problems are complexity and skill set. Complexity: kobernetes is only part of the solution. 10%. You also have observability, security, advanced networking, ci/cd, data/storage, multi-cluster/multi-cloud... Only after you have all those layers, then you're really production-ready and only then you can start migrationg yout … -
Fixing the "Data for this panel isn't available anymore" error in Django Debug Toolbar
Imagine this: you want to optimize your Django project's page loading times. To do this, you've installed the magnificent Django Debug Toolbar that will provide you with the necessary insight into how many queries your page generates. You click on the SQL panel in the Debug Toolbar, and... you get … Read now -
Django News - Django 5.0 Feature Freeze Coming Soon - Sep 15th 2023
News Status of 5.0 alpha release. Last call for new Django 5.0 features. If you have a specific PR you would like prioritized, please let them know by Monday, September 18, 2023. djangoproject.com Updates to Django We are nearly at the 5.0 feature freeze and still so much is happening! Last week we had 11 pull requests merged into Django by 8 different contributors - including 2 first time contributors! Congratulations to Oguzhan Akan and Jeremy Nauta for having their first commits merged into Django - welcome on board! Another amazing ORM feature has been added to 5.0, Django now supports database generated fields! This field can be used on all supported database backends to create a field that is computed from other fields. You can learn more about GeneratedField from the by reading the documentation. Congratulations to Jeremy Nauta, Lily Foote, Mariusz Felisiak, Adam Johnson and Paolo Melchiorre for their amazing teamwork to deliver this feature for us! Django Newsletter Sponsored Link gumroad.com Articles Optimizing Response Time: A Deep Dive with Lincoln Loop Analysis of a performance optimization journey with a large publishing platform using Django that serves hundreds of thousands to millions of page views daily. lincolnloop.com Rendering … -
Django: Move a template tag library into builtins
Django’s template engine has an underappreciated builtins option that selects libraries to preload in every template. Making a library a builtin avoids the need for an explicit {% load %} tag whenever you use its tags or filters. Putting key libraries in builtins can shorten your templates and make development a little bit faster. In this post, we’ll cover how to add a template library to builtins and remove existing {% load %} tags from your templates. Move a library to builtins Imagine you’re using my heroicons package to embed icons from the lovely heroicons. Your templates use the template library like so: {% load heroicons %} ... <button> {% heroicon_outline "beaker" %} Launch experiment </button> You realize that most of your templates use heroicons, making it worth adding to builtins. Here are the steps you’d follow to add it and clean up your templates. First, add the library’s full module path to builtins in OPTIONS: TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", # ... "OPTIONS": { "builtins": [ "heroicons.templatetags.heroicons", ], # ... }, }, ] Second, check it is correctly configured. Remove {% load heroicons %} from one template: -{% load heroicons %} ... <button> {% heroicon_outline "beaker" %} Launch … -
Foss4g.nl 2023: afternoon sessions summaries
(One of my summaries of the 2023 Dutch foss4g.nl conference in Middelburg). The story of maplibre native - Bart Louwers Bart is the full-time maintainer of MapLibre since early 2023. Maplibre is a map-rendering toolkit. Actually, it are two rendering toolkits: one for javascript/web and one for native (android/iphone). Native is the one he maintains. It renders vector data. The output is also vector tiles. Normally, a map server is used for the tiles, but you can also store tiles locally for offline usage. A server for vector tiles doesn't need to be a big machine: the layers he demoed were hosted on a raspberrypi in his basement. Vector tiles need styles. Those are defined in json. This gives you lots of flexibility. Night mode, different renderings for biking or walking, etc. Rendering is done on the client. This needs a GPU. On the web, it uses webgl. On the client it is OpenGL. Only... apple wants you to use their own "Metal" language. They are currently implementing support for that (he showed a quick demo). They are funded by sponsors. Several bigger companies (like Meta) sponsor it as it is way cheaper to do it collectively with other companies. … -
Foss4g.nl 2023: morning session summaries
(One of my summaries of the 2023 Dutch foss4g.nl conference in Middelburg). Community building - Frits Bussemaker Frits has been working for a long time as a community manager. Having a unique question helps in creating a community. You have an answer: it helps if the question is unique. Watch out with the words you're using, though, it is easy to use jargon that few people understand. What is a community? A group of people with a common goal or purpose. Though what people think it is can differ. If you look at a glass from the top, it looks like a circle. From the side the same glass looks rectangular. It is still the same glass. People can look for very different things in the same community. Membership of a community might be free (money). But definitively not free in your time. So pick your memberships wisely. And keep this in mind when trying to start a community yourself: don't start big, but small. See what works, see what doesn't work. Incremental changes and improvements can help you grow your community. But don't ignore the positive effect of those changes on your current members: changes and improvements can help … -
Foss4g.nl 2023: Bellingcat, investigating war crimes and more with open source geospatial data - Logan Williams
(One of my summaries of the 2023 Dutch foss4g.nl conference in Middelburg). (This was the closing keynote, btw). Full title: investigating war crimes, animal trafficking and more with open source geospatial data. He works with Bellingcat. An open source investigation journalism initiative. "Open source" isn't meant in the software way, but it means journalism sources. And then open sources like map info, databases, online photos. You also have gray areas like leaked materials. Bellingcat's first well-known investigation was the MH17 airplane disaster, shot down over Ukraine. In the days after the disaster, social media images and posts started to show up. Geolocatable images of the BUK missile system. Dashcam footage. Investigating individual photos can take a lot of work. Matching scuff marks on the pavement combined with the number of telephone poles in dashcam images... They managed to piece together the timeline and route of the BUK system. The info was even used in the court case in Den Haag. There are lots of sources of geographical information. Maps, satellite data. Images. Reflections in windows. Vessel/airplane tracking data. Most/all commercial vessels travel with location transmitters enabled. They are currently investigating Russian grain ships that illegally transport stolen Ukrainian grain by … -
19X faster response time
At Lincoln Loop, we don’t just build web platforms from scratch and scale them to accommodate growing demand; we also dedicate ourselves to their long-term maintenance. Some of our partnerships have spanned over a decade. Let me walk you through a performance optimization journey we undertook with a large publishing platform, which serves hundreds of thousands to millions of page views daily. The Issue at Hand Over the lifespan of a platform, various infrastructure changes and design tweaks can inadvertently impact the response time. For instance, adding more content to a page or changing the ordering of the results might bog it down. Continuous monitoring is critical because it allows us to spot such regressions quickly. A live website’s behavior varies significantly from local testing. Production sites deal with multiple cache layers and handle countless concurrent requests. In contrast, during “local” development, you typically turn off these cache layers and test one endpoint at a time. Thus, when embarking on performance optimization, always base your strategy on metrics from your production environment and tackle one modification at a time. For this optimization, I utilized AWS CloudWatch for response time metrics on the load balancer and some data from Sentry’s performance … -
Team size isn't a measure of success
Most managers have internalized the idea that team growth, in and of itself, is a unalloyed good, and a sign of success. This is wrong, but it’s understandable. Team growth feels like success, but headcount by itself isn’t a measure of success. Instead, we should judge management success by impact and efficiency. -
Django News - 2023 Django Developers Survey - Sep 8th 2023
News 2023 Django Developers Survey The DSF is partnering with JetBrains to run the 2023 Django Developers Survey. The survey is an essential metric of Django usage and helps guide future technical and community decisions and is open until October 1st, 2023, Anywhere on Earth (AoE). djangoproject.com Django security releases issued: 4.2.5, 4.1.11, and 3.2.21 These security releases address a potential denial of service vulnerability. We encourage all users of Django to upgrade as soon as possible. djangoproject.com Python Release Python 3.12.0rc2 Python 3.12.0rc2 is the last release preview for Python 3.12, scheduled for Monday, October 2nd, 2023. Now is an excellent time to start testing your applications and third-party libraries on Python 3.12 to ensure you are ready for the official release. python.org Last call for DjangoCon US Hotel Reservations DjangoCon US's discounted hotel rooms close on September 15th or as soon as they are gone. Please book today if you plan on attending in person this year. djangoproject.com Updates to Django Last week we had 12 pull requests merged into Django by 10 different contributors - including 2 first time contributors! Congratulations to Gnomeek and John Whitman for having their first commits merged into Django - welcome onboard! … -
SendGrid Inbound - Building SaaS with Python and Django #170
In this episode, we worked on the inbound hook to receive email responses from SendGrid using the service’s Inbound Parse feature. We worked through the configuration and addressed the security concerns with opening up a public webhook. -
Add robots.txt to a Django website
A "bot" is a general term for an automated program that does things like crawl the web. Google and other search engines rely on bots to periodically crawl the internet. … -
Django News - Python CVE Program - Sep 1st 2023
News The PSF has been authorized by the CVE Program as a CVE Numbering Authority (CNA) The Python Software Foundation is now a CVE Numbering Authority (CNA), enhancing the security response process for key Python projects, ensuring quicker CVE ID allocations, and offering consistent vulnerability disclosures led by their dedicated security team. blogspot.com Djangonaut Space Interest Form If you'd like to join or mentor the Djangonaut Space Contributor Program, here's how you can express your interest. google.com Wagtail CMS Results of the 2023 Wagtail Deployment Survey The results of the Wagtail Deployment Survey are here. wagtail.org Sponsored Link Sick of performance issues? Enter Scout's APM tool for Python apps. Easily pinpoint and fix slowdowns with intelligent tracing logic. Optimize performance hassle-free, delighting your users. Try us out for free! ter.li Articles How to create a Django form (using HTMX) in 90 seconds 🐎 Minimise javascript. Maximise building speed with Django and HTMX. photondesigner.com Klaviyo - Powering our APIs using *attr*active DTOs Klaviyo provides marketing automation and is built with Django. This post covers creating a company-wide API with over 150 endpoints spanning 12 product areas, processing millions of requests daily. klaviyo.tech Docker-compose autoheal: case sensitivity A common pitfall when using … -
Docker-compose autoheal: case sensitivity
I use docker-compose quite a lot. Most of the python/django stuff we deploy is done with docker-compose (one of the two big ones is in kubernetes already). A while back I moved several "geoservers" to docker-compose. Geoserver is a web mapping server written with java/tomcat. Normally pretty stable, but you can get it to crash or to become unresponsive. So that's something for which docker's health check comes in handy. You can configure it in docker-compose itself, but I put it in our geoserver's custom Dockerfile as I was making some other modifications anyway: FROM docker.osgeo.org/geoserver:2.23.1 ... some unrelated customizations ... HEALTHCHECK --interval=20s --timeout=10s --retries=3 --start-period=150s \ CMD curl --fail --max-time 3 http://localhost:8080/geoserver/web/ || exit 1 A simple "curl" command to see if the geoserver still displays its start page. With a generous --start-period as geoserver needs quite some time to start up. Docker-compose allows for healthchecks, and displays Up (healthy) in the "state" column when you call docker-compose ps. But docker-compose doesn't actually restart failed services. For that, you need docker-autoheal as an extra service. At the core, it consists of a single shell script that asks docker if there are containers matching the filter health=unhealthy and optionally autoheal=true. … -
Django News - Professional Djangonaut skills - Aug 25th 2023
News Python 3.11.5, 3.10.13, 3.9.18, and 3.8.18 is now available The latest Python versions, including a security release. blogspot.com Updates to Django During summer holidays we still had 4 pull requests merged into Django by 2 different contributors - including 1 first time contributor! Congratulations to jualvarez for having their first commit merged into Django - welcome on board! This week, we have some great opportunities for you to give back to Django! Are you a Windows user and have some time to help investigate a ticket? We need a little help investigating runserver: https://code.djangoproject.com/ticket/34787 Or perhaps you speak multiple languages and can help to translate djangogirls.org? You can contribute via this link: https://poeditor.com/join/project/n5I3liMVyj There's a lot of exciting work going on in the community currently! Giving back to Django has been truly an enriching experience for me and I hope you have the opportunity to raise your hand and make great new friends across the framework. 💚 Django Newsletter Sponsored Link Sick of performance issues? Enter Scout's APM tool for Python apps. Easily pinpoint and fix slowdowns with intelligent tracing logic. Optimize performance hassle-free, delighting your users. Try us out for free! ter.li Articles Professional Djangonaut skills · Better … -
Mailbag: Should you give candidates feedback on their interview performance?
Should you give unsuccessful job candidates feedback on what they did or didn’t get right? -
Customizing the Django Admin
In this article, we'll look at how to customize Django's admin site. -
Do I need a consultant, contractor or employee?
When is it the right choice to hire full-time staff, and when should you use consultants or contractors instead? The short answer: hire consultants for guidance, contractors for execution, and employees for stability and flexibility. For the long answer, read this article. -
SendGrid Outbound - Building SaaS with Python and Django #169
In this episode, we took another step closer to deploying the service online. The primary goal was to make sure that email sending works. I spent a lot of time explaining email configuration and showing exactly how to wire up SendGrid to Cloudflare to do Domain Authentication that permits email sending from the service’s domain (journeyinbox.com).