Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Safely rewriting complex code
There is a lot of advice out there suggesting to never rewrite anything. Just improve it in small increments. This is sound advice for services, modules or large chunks of code. Yet sometimes rewriting a complex part of your system will be inevitable. This does not mean the above advice does not apply. You still want to minimise risk and potentially try to ship smaller increments instead of rewriting 2000 lines of code in one go. No matter how big you deside to make the change, some guardrails and a safety net will come in handy. For basically any Python project one of the first developer dependencies I install is pytest. For Django projects I always add pytest-django. For feature flags my preferred library is Django Waffle. The code examples show how to use these three libraries to make a rewrite less scary. But there is no functionality exclusive to these three libs. You can easily replicate the approach with alternatives or in other languages and frameworks. The complete code and Django project can be found here. Starting simple One of the features I really appreciate is parameterize. You can add a list of values which is passed to your … -
Django News - Apply to be the next Django Fellow! - Jan 26th 2024
News Announcing: The Outstanding PyLady Award Do you know of a PyLady that should be recognized for all their work for Python and the community? Nominate them (or yourself)! pyladies.com Django Software Foundation DSF calls for applicants for a Django Fellow After five years as part of the Django Fellowship program, Mariusz Felisiak will step down as a Django Fellow in March 2024 to explore other things. Mariusz has made an extraordinary impact as a Django Fellow and has been a critical part of the Django community. Applications will be open until 1200 AoE, February 16, 2024, with the expectation that the successful candidate will be notified no later than March 1, 2024. djangoproject.com Updates to Django Today 'Updates to Django' is brought to you by Mohammad Alsakhawy from Djangonaut Space! Last week we had 16 pull requests merged into Django by 14 different contributors - including 3 first time contributors! Congratulations to Aivars Kalvāns, Alexis A., and Emmanuel Katchy for having their first commits merged into Django - welcome on board! Last week saw some exciting developments in 5.1: Model.refresh_from_db() and Model.arefresh_from_db() has a new parameter from_queryset that gives you more control over how the model is reloaded. makemigrations … -
When PyCharm Deletes Poetry Virtual Environments: The Fix
I use PyCharm as my Python IDE and Poetry for dependency and virtual environment management. However, the magnificent combination of these tools occasionally encounters a weird issue: PyCharm deletes the Poetry virtual environment when you launch the IDE. Though the problem occurs infrequently, when it does, it leads to a … Read now -
Payments Gateway - Building SaaS #181
In this episode, we continued on the Stripe integration. I worked on a new payments gateway interface to access the Stripe APIs needed for creating a check out session. We hit some bumps along the way because of djstripe’s new preference for putting the Stripe keys into the database exclusively. -
Payments Gateway - Building SaaS with Python and Django#181
In this episode, we continued on the Stripe integration. I worked on a new payments gateway interface to access the Stripe APIs needed for creating a check out session. We hit some bumps along the way because of djstripe’s new preference for putting the Stripe keys into the database exclusively. -
Datasette, LLMs, and Django - Simon Willison
Simon Willison’s WeblogDatasetteDatasette Cloud running on Fly.ioChoose Boring TechnologyDatasette enrichmentsLLM and LLM pluginsMistral, Mixtral, and ways to run it on LLMNYT lawsuit against OpenAIChatGPT for AppleScriptSimon uses https://llm.mlc.ai/#ios to run Mistral 7B on his iPhoneBuilding a Blog in DjangoSimon’s 15-year-old single file Django attempt djng and notesAI Superpowers bookSupport the ShowLearnDjango.comButtonDjango News newsletter -
pre-commit: Block files based on name with a custom “fail” hook
This post is an adapted extract from my book Boost Your Django DX, as updated last week. pre-commit’s “fail” virtual language fails all files that it matches. Combine it with pre-commit’s file name and type matching to block unwanted files in your repository. Let’s try it out with an example from working with Django’s fixtures system. Imagine you’ve recently transitioned your project from JSON to YAML fixtures because you prefer YAML’s readability. After converting all of your existing fixtures, you’re concerned that JSON fixtures may still get added in the future, complicating ongoing maintenance. You can prevent non-YAML fixtures from being added with a “fail” hook. Define such a hook in your .pre-commit-config.yaml as below. repos: - repo: local hooks: - id: check-fixture-types name: Check fixture types language: fail entry: Please convert non-YAML fixtures to YAML. files: /fixtures/ exclude_types: [yaml] Let’s take apart the hook definition. The first thing to note is that the hook appears under a repo: local declaration. This special repository location indicates that the hooks are defined in this repository rather than another. Several keys then define the hook: id defines the hook ID. Use the ID to refer to the hook on the command line … -
Farewell, Djangosites
The time has come for me to shut down Djangosites.org. This will happen in late January, 2024. When I started Djangosites back in 2007, Django was still a relatively young platform (having been an open-source project for only a few years) and besides the Lawrence Journal-World there were few … -
Django News - DjangoCon Europe 2025 Call for Proposals - Jan 19th 2024
News Mariusz Felisiak: "I've decided to retire from being a Django Fellow at the end of March 2024…" Django Fellow Mariusz Felisiak announced he is stepping down after five years. Thank you for all the hard work, Mariusz!!! mastodon.social DjangoCon Europe 2024 - Call for Proposals The CFP is open until March 1st to submit your talk proposals. evolutio.pt PSF: EU’s Cyber Resilience Act Passes with Wins for Open Source An important update on the EU's Cyber Resilience Act. blogspot.com PSF: Announcing the Deputy Developer in Residence and the Supporting Developer in Residence The Python Software Foundation has welcomed Petr Viktorin as the new Deputy Developer in Residence and Serhiy Storchaka as the Supporting Developer in Residence to form a full residency team focused on improving CPython, with funding from Bloomberg and an anonymous donor. blogspot.com Django Software Foundation DjangoCon Europe 2025 Call for Proposals DjangoCon Europe 2024 will be held June 5th-9th in Vigo, Spain, but they're already looking ahead to the 2025 conference. Learn more about what it takes to host this amazing conference! djangoproject.com Updates to Django Last week we had 15 pull requests merged into Django by 12 different contributors - including 4 first time contributors! … -
My Django roadmap ideas 💡
My ideas for the informal Django roadmap session for 2024, proposed by the new DSF board member, Thibaud Colas. -
Design and Stripe - Building SaaS #180
In this episode, I started with a plan to work on Stripe checkout, but realized that I needed to come up with a better plan and also improve the base template of the app. We ended up doing more design work than working with Stripe, but we ended the stream with a solid plan of what to do next. -
Design and Stripe - Building SaaS with Python and Django #180
In this episode, I started with a plan to work on Stripe checkout, but realized that I needed to come up with a better plan and also improve the base template of the app. We ended up doing more design work than working with Stripe, but we ended the stream with a solid plan of what to do next. -
Weeknotes (2024 week 03)
Weeknotes (2024 week 03)Djangonaut Space I wish all participants a good time and much success. I do not have anything to do with it really but I enjoy the idea a lot and maybe there will be a pull request or two to review. Kubernetes After years and years of hosting all sites on VPS I have finally reached the point where the old setup is more annoying to work with than switching to a new one. I have searched long for a solution which wasn’t as limited as some PaaS and as complex as going full Kubernetes, and where I can still delegate the responsibility of actually keeping things up and running to other people. In the end I have now accepted that such a thing doesn’t exist; either you have the limitations of a ready made solution, the limitation of having to open many many support tickets or the problem of having to learn Kubernetes (or something similar) with its extremely steep learning curve. After spending days with it I’m slowly getting to the point where setting up local development environments and deploying changes is fun again. I’m using the GitOps paradigm; while I’m still building and uploading … -
Boost Your Django DX update out now
I just released a major update to my 2021 book Boost Your Django DX. This update contains new content, a bunch of edits, and uses the latest versions of tools, including Python 3.12 and Django 5.0. Boost Your Django DX contains many recommendations to improve your development experience (DX) while working on Django projects. It covers code quality tools (linters and formatters), virtual environments, models, migrations, settings, and even documentation. See below for the full updated table of contents. The book has sold over one thousand copies, including some large team licenses. I hope this update extends its utility and helps even more developers work smarter. This update is free for all who previously purchased the book, and I’ve sent an email out to notify readers. There’s a changelog in the first chapter with links to the changed sections, reproduced below. As part of this update, I’m increasing the price from $39 to $42. This headline price is automatically discounted up to 60% to match local purchasing power in your country. There’s also a bundle deal with my new Git book, and team licenses are available. Buy now on Gumroad May you embrace the spirit of continuous improvement this year, … -
Django News - It's Migrations week 📦 - Jan 12th 2024
Django Software Foundation DSF membership now recognizes a much broader range of contributions to Django The Django Software Foundation has updated its bylaws to represent better who may be a member. djangoproject.com DSF Board 2024 Elections – New board members 👋 Following the 2024 DSF Board Election Results, here are quick introductions from our two new board members, Sarah Abderemane and Thibaud Colas. djangoproject.com Updates to Django Last week we had 17 pull requests merged into Django by 9 different contributors - including 2 first time contributors! Congratulations to Michael, and Zowie Beha for having their first commits merged into Django - welcome on board! Last week saw a bunch of updates to GeoDjango. From 5.1: BoundingCircle will be supported on SpatiaLite 5.1+. Collect will be supported on MySQL 8.0.24+. GeoIP2 will allow querying using ipaddress.IPv4Address or ipaddress.IPv6Address objects. Also note that Django 5.1 has deprecated passing positional arguments to Model.save() and Model.asave() in favor of keyword-only arguments. Django Newsletter Wagtail CMS Discover Wagtail AI Webinar Whether you're a content creator, a tech enthusiast, or on the lookout for a CMS with advanced AI capabilities, this event is designed with you in mind. bit.ly Recovering deleted Wagtail pages and Django … -
Accessibility - Sarah Abderemane
Sarah Abderemane’s website [@sabderemane on Mastodon](https://mastodon.social/@sabderemane/)Octopus EnergyDjango Accessibility TeamDjango DiscordDjangonaut SpaceWhoCanUseAccessibility on the Django ForumPyLadies Con 2023: Djangonaut Space, how we organized a mentorship programDjangoCon 2020 | Accessibility wins for Django projects - Thibaud ColasSupport the ShowLearnDjango.comButtonDjango News newsletter -
Philanthropy Update
Lessons learned and updates from a couple of years of executing on my philanthropic plan: finding and tracking organizations, continuing to wrestle with anonymity, and a list of donations we’ve made. -
Django Stripe Tutorial
In this tutorial, we will create a Stripe-powered Django website to handle purchases. The final site will have a homepage for orders, a success page when an order goes through, … -
Django News - Django bugfix releases issued: 4.2.9 and 5.0.1 - Jan 5th 2024
News Django bugfix releases issued: 4.2.9 and 5.0.1 Django 5.0.1 fixes eight different bugs in 5.0. djangoproject.com DjangoCon Europe 2024 CFP Now Open The Call for Proposals (CFP) is open now, and will be until midnight on February 29th. djangoproject.com django CMS 4.1 is here! - django CMS django CMS 4.1 brings a brand new approach to content management. Bringing version control, improved front end editing and configurable content creation workflows. django-cms.org 2FA Required for PyPI PyPI now requires 2FA for all users. pypi.org Updates to Django Django didn't stop for the holidays! Last week we had 19 pull requests merged by 13 different contributors - including 5 first time contributors! Congratulations to Salvo Polizzi, virgitl.io, Rigoberto Villalta, Paul Bailey, and Mohammad Yameen for having their first commits merged into Django - welcome on board! Last week a new feature landed in Django 5.1. F() and OuterRef() expressions that output CharField, EmailField, SlugField, URLField, TextField, or ArrayField can now be sliced! See the docs on Slicing F() expressions for more details. To quote Nick Pope: "Maybe after 5 years, 5 pull requests, and 6 authors we're finally there... 😅". Congratulations and thank you to Nick Pope, Priyansh Saxena, Niclas Olofsson, … -
Collapsing Django's Migrations
Long-running Django projects can start to create a lot of migrations. After just a few years, an actively developed project can create thousands of them! This can put a serious dent in your test running, because (a) Django runs the migrations at test time to setup your database, and (b) you can't test your migrations unless you're happy to have 30min CI runs! Migrations can also often be a painful source of technical debt, since they sometimes import libraries that you don't use anymore, but can't remove because someone, some day will try to run manage.py migrate from scratch only to have it blow up looking for a dependency you don't actually use anymore. So, looking down the barrel of a performance, tech debt, and stability headache, it's a good idea to pay some attention to your migrations from time to time. Option 1: squashmigrations This is the official advice. You run this command and Django will effectively squash all of your existing migrations into one Great Big Migration, so where you before you had: 0001_initial.py 0002_something.py ... 0132_something_else.py you now have: 0001_squashed_0132_something_else.py This is pretty slick, because it doesn't actually need any database changes. You're just merging the administrative … -
How Are Requests Processed in Flask?
This article shows the key steps for when a request is processed in Flask and the callbacks available to customize the processing of a request. -
Legal and Stripe - Building SaaS #179
In this episode, we took care of the legal obligations of the site by setting up Terms of Service and a Privacy Policy page. Then we moved on to the next portion of signup, which is to configure Stripe to create customers and prepare, ultimately, to accept subscription payments. -
My Diverse Hiring Playbook
I’m really proud of my track record building diverse teams. When I’ve been responsible for hiring, those teams have consistently been more diverse than industry norms, often significantly so. Over the years, I’ve developed a set of “plays”, some go-to tactics for increasing the diversity of my hiring pipeline. This is that playbook. -
Legal and Stripe - Building SaaS with Python and Django #179
In this episode, we took care of the legal obligations of the site by setting up Terms of Service and a Privacy Policy page. Then we moved on to the next portion of signup, which is to configure Stripe to create customers and prepare, ultimately, to accept subscription payments. -
Weeknotes (2024 week 01)
Weeknotes (2024 week 01)First weeknotes post for 2024! Happy new year! Looking back on 2023 Writing I have published almost 40 posts last year. That’s almost as many posts as I published in the time period from 2014 to 2023. Coworking to write more does work. I already had a quite active blog from 2005 to 2008 with a few posts after that; everything before 2014 was in german and mainly concerned with green politics and climate change. I’m still very interested in these topics but I don’t feel as if I have much to add to the conversation, even though it’s the more important issue. Open Source Not much changed here. I enjoy basically everything I do in open source land, and co-maintaining the Django Debug Toolbar with Tim is a joy. I still wish that some of my projects had more impact in Django land, especially those who augment the Django administration interface to be a lightweight CMS which requires very little maintenance and work in the long run. I think it’s great that one of the core components, django-content-editor, hasn’t required a release in more than one year. It doesn’t have to be expanded because it just …