Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
My Django wishlist explained
Recently Andy Miller - AKA nanorepublica posted in various media about missing Django batteries, including but not limited to this forum thread and articles series. He's not the only one, I have seen similar posts from several other people in my circles. Here I'll try to explaining my take on the original forum question -
Django News - Python 3.13 and Django 5.1.2 bugfix released - Oct 11th 2024
News Django bugfix release issued: 5.1.2 Three new bugfixes in the latest release. As always, the best security policy is being on the latest version of Django. djangoproject.com Python 3.13.0 released The official release for Python 3.13 and a listing of new and deprecated features. What's New in Python 3.13 is a detailed look at all the new features. python.org Python Insider: Python 3.12.7 released The seventh maintenance release of Python 3.12 is now available. blogspot.com Join the Python Developers Survey 2024 The annual Python Developers Survey is now live. This is your chance to weigh in on the current state of the language and the ecosystem around it. blogspot.com Django Software Foundation 2025 DSF Board Nominations Another reminder that nominations are open for the Django Software Foundation Board. Of our 7 directors, there are 4 positions currently open, with each position serving for two years. djangoproject.com If we had $1,000,000… Jacob Kaplan-Moss expanding on his DjangoCon US talk on what the DSF might do with more money. jacobian.org DSF initiatives I'd like to see An article-length gist from Django Fellow Sarah Boyce on what the DSF Board (and new members!) might accomplish. github.com Thoughts on the Treasurer Role at … -
Pycon NL: Localization and translation of programming languages - Felienne Hermans
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Localisation and translation of programming language: how to make programming languages more inclusive and why that matters. Felienne is professor at the vrije universiteit in Amsterdam. She also works at a school teaching 12 year olds. Those 12 year olds wanted to learn programming and she agreed to teach it. When she herself learned programming, it was in the 1980's without any adults in her environment to teach her. So she typed over some Basic code from a book and learned herself. That's how she learned programming. The compiler was the teacher and she learned to read error messages. But current 12 year olds don't learn that way: > print("Hello world") # <= Note the extra space in front of print ^^^ IndentationError "Teacher, what is an indentationerror?". Or rather in Dutch "juf, wat betekent een indentation error". So she tried to write a much simpler language to teach the kids. Simple code. "Lark" translates it to proper syntax. This is then converted to an "AST", abstract syntax tree. Which is then converted to python. See https://www.hedycode.com/ A request that came up quickly was if the keywords … -
Pycon NL: How bazel streamlines python development - Alexey Preobrazhenskiy
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Full title: how bazel streamlines python development: stories from the Uber monorepo. Monorepo: a single repository that contains multiple distinct projects, with well-defined relationships. There are advantages to monorepo's like developer productivity: code sharing, component reuse, reducing duplication. Atomic commits across components: you fix everything everywhere in one commit. And you have consistency and a common way of working. Bazel: https://bazel.build/ . A build system that allows you to define tools and tasks by writing code. With an ever-growing build-in set of rules to support popular langauges and packages. Bazel's language is called starlark, which is inspired by python. Some semantics differ, but the behaviour is mostly the same. Do you even need a build tool for python? Well, perhaps you have compiled cython modules. Or a javascript frontend. Code generation? In any case you probably need to generate deployable artifacts like wheels or debian packages. They wrote git-filter-repo to help you merge an existing repo into a monorepo, preserving the history. There is support for running tests. And optionally caching test results to prevent re-running unneeded tests (important in a huge code base). Caching is hard, … -
Pycon NL: Efficient python project setup with cookiecutter - Merel Theisen
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Full title: efficient python project setup: showing cookiecutter's potential within Kedro. Kedro: https://kedro.org/, "a toolbox for production-ready data science". Open source, python. It helps you apply regular software engineering principles to data science code, making it easier to go from prototype to production. Things like Jupyter notebooks are great for experimenting, but not nice when you throw it over the wall to some programmer to clean it up and convert it to "real" code. Kedro consists of: Project template. This is done with cookiecutter. Data catalog. Core declarative IO abstraction layer. Nodes + pipelines. Experiment tracking. Extensibility. Cookiecutter: https://cookiecutter.readthedocs.io/ . You use cookiecutter (the program) to create projects from "cookiecutter templates". Such a template gives you a repository structure out of the box, filled in with some parameters that you provide like the name of the project. Cookiecutter reads a settings file and prompts you interactively with some variables it wants you to provide. It then reads a directory structure and generates an output directory based on it. Really handy, as you normally get a README, some pyproject.toml or so, a proper directory structure, perhaps a sample … -
Pycon NL: Past, present and future of python parallelism - Pavel Filonov
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). In his job, he's waiting a lot. Waiting for his machine learning stuff to finish. Waiting for results to be calculated. In c++ you'd start enabling multiple processing to get your entire processor to work. How how about python? He showed a simple function to calculate prime numbers. A CPU bound problem. Everything he tests is run on an AWS t3.xlarge 4 CPU machine, The present Just simple single core. Pure non-parallel python. 1430 ms to calculate. You can use python extensions: you code it in c++ and use some library for splitting it up in multiple tasks. 25 ms, 60x faster. You can use python's own multithreading, using ThreadPoolExecutor. 1670 ms: wow, it is a little bit slower. Which is to be expected as the problem is CPU bound. Similar approach, with multiprocessing. ProcessPoolExecutor with three CPUs as worker. 777 ms, about twice as fast. Many python data processing libraries support multiprocessing. It is a good approach. The future You can look at multiple interpreters. PEP 734. And there's a PEP to have a GIL ("global interpreter lock") per interpreter. If you start up multiple interpreters, … -
Pycon NL: From state machines to event-sourced systems - Lukáš Ševčík
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Full title: Events in fintech: from state machines to event-sourced systems. He works at kiwi.com, a payment processor. They recently refactored their systems to be more event-based. Previously, they used state machines. A payment/customer/whatever can be in several well-defined states. Between states (but not necessarily between all states) there are transitions. Advantages of state machines: they're simple. Easy to understand. They're efficient. Easy to test: just states and transitions. Disadvantages: there's no inherent history. That's sometimes bad, as it is hard to answer "why is my payment in this state?!?" There's also lack of context. And changing a state machine can be hard. Some problems they encountered: race conditions. Two states are started for the same account. One gets a +15, the other a -20. As the states don't know about each other, the resulting account balance can be incorrect. Now on to events. Event sourcing / event driven architecture is what he called it. You start with a command "withdraw money, amount = 15". This gets placed in a queue and gets processed. The processing results in another event "15 has been removed" that gets send … -
Pycon NL: The zen of polymorphism - Brett Slatkin
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Brett is the writer of the effective python book. As an example, he picked a calculator that can add and multiply integers. The numbers, the operators: everything is an object in his example. You can do it with one big function, object oriented or with dynamic dispatch. One big function: just a big old recursive function with a lot of if/else. Just something to get started. Once you add more operators ("power of", "square root"), the if/else quickly gets out of hand and becomes much to long and unreadable. And lets say you don't only want to do the calculation, but you only want to have a nicely printed version of the calculation. Suddenly your only choice is to copy/paste the entire big function and change the calculation to print statements. And then you need to keep the two in sync... Second try: object oriented programming. Polymorphism. A generic Operator class with a calculate() method. Then subclasses called Add, Multiply, etc. Python does a magical thing: you can just call calculate() on whatever operator. Python handles part of the if/else for you. It calls the right calculate … -
Pycon NL: The zen of polymorphism - Brett Slatkin
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Brett is the writer of the effective python book. As an example, he picked a calculator that can add and multiply integers. The numbers, the operators: everything is an object in his example. You can do it with one big function, object oriented or with dynamic dispatch. One big function: just a big old recursive function with a lot of if/else. Just something to get started. Once you add more operators ("power of", "square root"), the if/else quickly gets out of hand and becomes much to long and unreadable. And lets say you don't only want to do the calculation, but you only want to have a nicely printed version of the calculation. Suddenly your only choice is to copy/paste the entire big function and change the calculation to print statements. And then you need to keep the two in sync... Second try: object oriented programming. Polymorphism. A generic Operator class with a calculate() method. Then subclasses called Add, Multiply, etc. Python does a magical thing: you can just call calculate() on whatever operator. Python handles part of the if/else for you. It calls the right calculate … -
Pycon NL: Using PyPI trusted publishing for ansible releases - Anwesha Das
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Using software is easy, releasing software is harder. Originally trained as a laywer, she wondered why software had to be released so often. As a lawyer, she had to work with laws sometimes already written in 1860 :-) Nowadays she is the release manager of ansible. Ansible is ansible-core in combination with 95+ different python modules called collections. Originally, releasing to the python package index, pypi, wasn't really safe. Every person doing the release needed some __token__ in their ~/.pypirc. This can be compromised. And the token can be overscoped. And... can you be sure that every person doing the release is doing it in a safe way? That the person's laptop is secure enough? Pypi now allows you to use trusted publishing. OIDC, "openID connect", is used behind the scenes to connect pypi to github/gitlab/etc. It is a way to create short-lived tokens to upload to pypi from a github/gitlab job. A specific github repository and specific github action within that repository is set up as "trusted" by one of the maintainers of the project on pypi. The github action will, when uploading, use the OIDC … -
Pycon NL: Strategies for avoiding package.json for fullstack python devs - Donatas Rasiukevicius
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). In 2024, what is a fullstack python dev? Well, python. Database administrator. Integrator with external services. A bit of terraform or kubernetes. AWS clicky-clicky expert. And a bit of frontend. So the frontend is only a small part of your job. You have a package.json that makes no sense to you, so you just npm install it and download the entire internet into your local node_modules/ folder. But somehow it seems to work. The frontend? You have frameworks. More frameworks. Meta-frameworks that framework your frameworks. Frameworks don't make things simpler, they just move the complexity somewhere else. If you use django's ORM, you don't have to deal with the complexity of SQL. But in exchange you have to learn the django ORM. He wants to look at three layers: Markup / html. Styling / css / design systems. Interactivity / javascript. Markup and html. On one hand you can have bindings. "Fasthtml", for instance. A mapping from python to html. return Div(H1("hurray")). You just move the complexity. Or "native web components". You have custom <star-rating> elements that get translated into actual html. You need specific javascript code … -
Pycon NL: How functional programming can help you write better python code - Arjan Egges
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). You might start with some simple python code. Just a few functions. It grows and grows. Now... how do I structure this? You start looking at complex enterprise code? Object oriented programming? Software patters? Why not look at functional programming? Arjan showed some simple code with a class in it. A customer wish resulted in a subclass with some custom behavior. But if you'd change the original class, you'd also change the subclass's behaviour. Brittle. Often, subclassing is discouraged. The "rust" language even doesn't include subclassing. With some live coding, he re-wrote the class to functions. You can pass functions as variables in python. Another trick is to use "closures": a function that builds and returns a function: def is_elegible(cutoff_age: int = 50) -> Callable[[...]]: def is_eligble_function(customer, cutoff_age): return customer.age > cutoff_age return is_eligble_function You can do this more elegantly with from functools import partial. That's a decorator you can use on an existing function. The example code is at https://github.com/arjancodes/pycon_nl Functional programming concerns itself more with the flow of information. It can be more elegant if it fits your problem. Object oriented programming concerns itself more … -
Pycon NL: The attentive programmer - Daniele Procida
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Personal note beforehand: I'd like to point at a previous talk by Daniele at djangocon EU in 2014 about diversity in our industry. Daniele once interviewed a programmer for a position. "Why do you enjoy programming?" The answer: "When I'm programming, I'm a god. I create things out of clean air." You can create things. It is more than "doing things". Or "merely commanding". I cannot make something exist in the real world just by saying "let there be light". But in programming I can! I can do x = 1 or c = Camera(). Programming as intention. "Fiat voluntas tua", thy will be done. You want something. In programming, you even write tests to check whether what you intended actually turned out right :-) Daniele likes to program, but isn't really good at it. Which is fine with him. He also likes photography, but isn't really good at it, too: this one hurts him quite a bit more. A famous photographer once said "your first 1000 photos are your worst". But once you stop for a while, the counter seems to reset to zero. Programming as … -
Built with Django Newsletter - 2024 Week 41
Hey, Happy Tuesday! 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 Last week Ramy from Hovercode purchased my first ad space! Thank you Ramy! Still trying to grow a pair and start recording video tutorials for you guys. Decided to keep my skills fresh and relevant and built a new app over the weekend. OSIG is a free and open-source solution to generating beautiful OG images on the fly! I shared the project on Hacker News today, would mean a lot if you could support it :) Thanks a ton in advance. Sponsors This issue is sponsored by OSIG. Well, sponsor is a strong word. It is just another project of mine that I wanted to share with you 🙈. Fully free! If you want an automated way for generating OG images for social media, this might be for you. If you want to become a real sponsor, just reply … -
If we had $1,000,000…
What would the Django Software Foundation look like if we had 4x our current budget? -
Django News - 2025 DSF Board Nominations - Oct 4th 2024
News PyCharm & Django Campaign 2024 - encore Each year, our friends at JetBrains, the creators of PyCharm, run an incredible deal. You get a 30% discounted year of PyCharm, AND the DSF gets 100% of the money. Yes, 100%! djangoproject.com 2025 DSF Board Nominations Nominations are open for the 2025 Django Software Foundation Board of Directors. Of our 7 directors, there are 4 positions currently open, with each position serving for two years. djangoproject.com Django TV A new website dedicated to promoting Django and Python videos from conferences. Read more about the inspiration here. djangotv.com Speaking at PyTexas - PyTexas Conference Our CFP opens October 1, 2024 and closes December 1, 2024. pytexas.org DJP: A plugin system for Django DJP is a new plugin mechanism for Django, built on top of Pluggy. I announced the first version of DJP during my talk yesterday at DjangoCon US 2024, How to … simonwillison.net Updates to Django Today 'Updates to Django' is presented by Raffaella Suardini from Djangonaut Space! Last week was DjangoCon US but we still had 4 pull requests merged into Django by 4 different contributors. These included a regression fix in Django 5.1 that caused a crash when using … -
Custom Django Python Migration
Sometimes I find myself wanting to add some model objects along with a feature. You can make a custom migration to handle that! Overview of what we will do Create an empty migration Create a forwards operation Create a backwards operation Tie those operations to the migration Apply, un-apply, and re-apply the migration Whole file contents For a tl;dr, make an empty migration and populate it like this: # Generated by Django 5.1.1 on 2024-10-03 12:59 from django.db import migrations def forwards(apps, schema_editor): MyModel = apps.get_model('my_app', 'MyModel') MyModel.objects.create( field_name1="name", field_name2="describe" ) def backwards(apps, schema_editor): MyModel = apps.get_model('my_app', 'MyModel') MyModel.objects.get( field_name1="name", field_name2="describe" ).delete() class Migration(migrations.Migration): dependencies = [ ("app_name", "0001_initial"), # could be more here ] operations = [ migrations.RunPython(forwards, backwards), ] Create an empty migration python manage.py makemigrations --empty I tend to add a descriptive name as well: python manage.py makemigrations \ --name \ --empty The empty file should look something like this: # Generated by Django 5.1.1 on 2024-10-03 12:59 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("app_name", "0001_initial"), # could be more here ] operations = [] Create the change you want to see Next, I'm going to add a top-level function that runs the code … -
DjangoCon US 2024 Recap - Tim Schilling
Better Simple websiteTim on Mastodondjango-commonsDjango commons discussionsAspirEDUDjangonaut Space and on Open CollectiveDEFNADjangoCon US 2025 Call for VolunteersLacey’s interview with Jay Miller at DCUS2024Google Summer of Code - Django Debug ToolbarSponsorDjango + HTMX Course at TalkPython Training 10% off -
Ethical Applications of AI to Public Sector Problems
There have been massive developments in AI in the last decade, and they’re changing what’s possible with software. There’s also been a huge amount of misunderstanding, hype, and outright bullshit. I believe that the advances in AI are real, will continue, and have promising applications in the public sector. But I also believe that there are clear “right” and “wrong” ways to apply AI to public sector problems. -
Say Goodbye to FOMO: How I Built a Telegram Bot to Keep You on Top of Important Conversations
No more FOMAIntroduction:In today’s hyper-connected world, many of us experience FOMO — the Fear of Missing Out. It’s the anxiety that critical information or events are happening, and you’re not aware of them. This is especially true for fast-paced Telegram channels, where immigrants and other communities share essential updates about legal assistance, jobs, and housing.To address this, I built a Telegram bot that helps eliminate FOMO by summarizing past and recent conversations. It highlights key points and urgent matters, giving you a quick overview of what you should care about. The bot not only analyzes current chats but also processes conversation history, allowing you to get insights from past years’ discussions. It leverages OpenAI’s chat completion and file search tools to deliver the information you need in a concise, actionable format.Key Features of the Bot:Summary Generation: The bot creates concise summaries of both current and past conversations.Urgent Alerts: It highlights urgent messages that require immediate attention.Customizable Insights: You can focus the bot on specific themes, keywords, or time periods.Historical Analysis: It processes exported conversation history files from official Telegram clients, giving you insights from past years’ discussions.Multi-Channel Support: The bot monitors multiple channels and provides summaries across conversations.What is FOMO … -
Django News - 2025 DSF Board Nominations - Sep 27th 2024
News 2025 DSF Board Nominations Nominations are open for the 2025 Django Software Foundation Board of Directors and there are 4 positions currently open, with each position serving for two years. djangoproject.com PyCharm & Django Campaign 2024 - encore The Django Software Foundation's biggest fundraising event of the year is here! djangoproject.com Updates to Django Today 'Updates to Django' is presented by Raffaella Suardini from Djangonaut Space! Last week we had 18 pull requests merged into Django by 14 different contributors - including a first-time contributor! Congratulations to r0Zh-ovanya for having their first commits merged into Django - welcome on board! News in Django 5.2: CharField.max_length is no longer required to be set on SQLite, which supports unlimited VARCHAR columns. PR #18582 Data loaded from fixtures and from migrations enabled with serialized_rollback=True are now available during TransactionTestCase.setUpClass(). PR #18514 Each serialization format now defines a Deserializer class, rather than a function, to improve extensibility when defining a custom serialization format. PR #18335 Django Newsletter Sponsored Link 1 Get 30% off PyCharm. 100% Donated to Django. Support the rapid development of Django! Until October 7th, get PyCharm for your Django development with a 30% discount via this link. All proceeds will … -
Postgres to SQLite - Building SaaS #204
In this episode, we worked on the cloud migration’s data strategy. I focused on how to convert a Postgres database into a SQLite database and planned out the process that I will follow to do the actual migration. -
Postgres to SQLite - Building SaaS #204
In this episode, we worked on the cloud migration’s data strategy. I focused on how to convert a Postgres database into a SQLite database and planned out the process that I will follow to do the actual migration. -
Developing with Docker
You'd think that this topic would have been done to death, but given that every job I've started in the past 10+ years has used Docker differently (if at all) to varying degrees of success, I feel like we need some sense of consensus around how to Do This Right™. And, as someone with an ego the size of a small moon, I'm here to decide what's right... on my own blog anyway. The argument here is that the use of Docker and various tooling shouldn't be unique to any particular project, that this sort of thing should be so standard it's both common and boring to even think about. My experience tells me that we're not there yet though, so this is just me making the case for what I think constitutes a good setup. Thesis The main argument I want to make is that if you're using Docker, you don't write software anymore, but rather you build immutable images. Images that are developed locally, tested in CI, and deployed to production, but importantly, the image at each of these stages is exactly the same: reproducible at every turn. There's little value in developing and testing one thing if … -
Django: Introducing Djade, a template formatter
Happy DjangoCon US 2024 to you. Whilst I am not there, I have adopted the spirit of the season and got to work hacking together a new tool. Djade is a formatter for Django templates. It applies rules based on the template style guide in Django’s contribution documentation, plus some more. Ryan Cheley put together this section back in February (forum discussion). I enjoyed contributing to this discussion and wrote “I’d love to work on a formatter tool to match the guide”. Well, now I did it :) Djade has a similar philosophy to Black, the popular Python code formatter: You can have any colour you like, as long as it’s [d]jade. Djade has no options, just one consistent style, open to community discussion. It also aims to format only Django template syntax, leaving the surrounding language syntax (HTML, TXT, XML, ...) untouched for safety. Djade is built in Rust, using a translation of the relevant parts of Django’s template parser. It’s fast: a quick benchmark on my MacBook shows it takes ~20ms to format 377 templates in one project. Run Djade on your template files directly or with its pre-commit integration. You’ll find it makes changes like: -{% extends …