Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Polish, Debug Toolbar, Email Signals - Building SaaS with Python and Django #193
In this episode, we first added the Django debug toolbar to aid future troubleshooting. Then, following some PR cleanup, I added django-denied as the authorization framework for the site. With those two packages integrated, I did some polishing work and began the effort to send prompts immediately following email verification. -
Approximate Counting in Django and Postgres
This article looks at how to speed up counting with Django and PostgreSQL. -
Django News - DEP 14 (Background Workers) Approved! - May 31st 2024
News Django Enhancement Proposal 14: Background Workers DEP-14 has been approved that focuses on background workers. djangoproject.com PSF News: Thinking about running for the Python Software Foundation Board of Directors? Let’s talk! PSF Board elections are a chance for the community to choose representatives to help the PSF create a vision for and build the future of the Python community. This year, there are three seats open on the PSF board. blogspot.com Updates to Django Last week we had 19 pull requests merged into Django by 14 different contributors - including 3 first-time contributors! Congratulations to い。, Peter Bittner and Ryan Hiebert for having their first commits merged into Django - welcome on board! Here are some of the final changes merged into Django 5.1 before the feature freeze: The new django.core.validators.DomainNameValidator validates domain names, including internationalized domain names. The new django.contrib.auth.middleware.LoginRequiredMiddleware redirects all unauthenticated requests to a login page. Collapsible fieldsets are now accessible for screen readers. Please read the release notes for 5.1 and test the new features - this really helps Django 5.1 to be a success! Django Newsletter Sponsored Link Free Trial of Scout APM Today! Need answers to your Django app questions fast? Avoid the … -
About, FAQ, and Home Page - Building SaaS #192
In this episode, we worked on some core pages to round out the JourneyInbox user interface. This led us to work updating UI layout, writing copy, and doing other fundamentals for making templated pages. -
About, FAQ, and Home Page - Building SaaS with Python and Django #192
In this episode, we worked on some core pages to round out the JourneyInbox user interface. This led us to work updating UI layout, writing copy, and doing other fundamentals for making templated pages. -
Buttondown - Justin Duke
Justin’s personal siteButtondownButtondown’s Tech StackUses ThisChoose Boring TechnologySponsorMailtrap.io -
Rapidly creating smoke tests for Django views
A management command for quickly generating tests based off Django's URL routing mechanism. Recently Peter Baumgartner of Lincoln Loop wrote a fantastic article about the technique of writing smoke tests for Django views. Go read it, Peter provides really good justification for these smoke tests, especially for taking on legacy project without tests. Heck, the reason why I'm writing this post is so I have it in the bookmark service that is my blog. Inspired as I was by Peter's article, I wrote a little management command to help build out smoke tests quickly. It's not perfect, and chances are you'll need to modify the results for the tests to be accurate. Certainly you'll need to add filtering like what I did with the admin to account for third-party packages that already have tests. Nevertheless, I've found it a useful tool for writing out smoke tests quickly. In this example, it generates smoke tests to be called by pytest via pytest-django. It can be modified to work with standard Django unit tests. # myapp/management/commands/make_smoke_tests.py from django.core.management.base import BaseCommand from django.urls import get_resolver class Command(BaseCommand): help = 'Generates smoke tests for projects.' def handle(self, *args, **options): urlconf = get_resolver(None) self.generate_smoke_tests(urlconf) def … -
Rapidly creating smoke tests for Django views
A management command for quickly generating tests based off Django's URL routing mechanism. Recently Peter Baumgartner of Lincoln Loop wrote a fantastic article about the technique of writing smoke tests for Django views. Go read it, Peter provides really good justification for these smoke tests, especially for taking on legacy project without tests. Heck, the reason why I'm writing this post is so I have it in the bookmark service that is my blog. Inspired as I was by Peter's article, I wrote a little management command to help build out smoke tests quickly. It's not perfect, and chances are you'll need to modify the results for the tests to be accurate. Certainly you'll need to add filtering like what I did with the admin to account for third-party packages that already have tests. Nevertheless, I've found it a useful tool for writing out smoke tests quickly. In this example, it generates smoke tests to be called by pytest via pytest-django. It can be modified to work with standard Django unit tests. # myapp/management/commands/make_smoke_tests.py from django.core.management.base import BaseCommand from django.urls import get_resolver class Command(BaseCommand): help = 'Generates smoke tests for projects.' def handle(self, *args, **options): urlconf = get_resolver(None) self.generate_smoke_tests(urlconf) def … -
Workbench: Coffee time!
Workbench: Coffee time! I have written about the Workbench agency software a few weeks back. Back when we were using Slack at Feinheit we used a Donut bot to generate randomized invites for a coffee break. We lost that bot when we switched to Discord. I searched some time for an equivalent bot for Discord but couldn’t find any, so like any self-respecting nerd, break lover and NIH-sufferer I reimplemented the functionality as a part of our agency software. The first version generated totally random pairings without any history; I thought that maybe this would be good enough, but of course I received an invite for a coffee with the exact same person in the first two invitations. Even though I did enjoy the break both times this motivated me to put some effort into a better solution :-) The result of this work is the coffee_invites() function There are two main parts to the generator: It randomly generates twenty pairings from all participants; it prefers groups of two except for the last group which may contain three people. It loads old pairings from the database and gives higher penalties to equal pairings depending on the time which has passed … -
Django News - Django 5.1 alpha 1 released - May 24th 2024
News Django 5.1 alpha 1 released Django 5.1 alpha 1 is now available. It represents the first stage in the 5.1 release cycle and is an opportunity for you to try out the changes coming in Django 5.1. djangoproject.com Updates to Django Today 'Updates to Django' is presented by Lilian from Djangonaut Space! Last week we had 11 pull requests merged into Django by 8 different contributors - including 1 first-time contributor! Congratulations to Zeyad Moustafa for having their first commits merged into Django - welcome on board! Ever wonder about the tradeoff between security and performance of password hashers? Django's ScryptPasswordHasher originally had the parallelism parameter set to p=1, however OWASP has a recommendation of p=5. PR #18157 includes this change to follow the recommendation and is part of Django 5.1. In other news, Google Summer of Code officially kicks off next week, and there are four Django projects this year! Congratulations to the participants, and have fun working on these interesting projects! AmanPandey - Add Async Support to Django Debug Toolbar Salvo Polizzi - Auto Importing Shell Csirmaz Bendegúz - Django ORM support for composite primary keys Shafiya Adzhani - Add support for using key and path transforms … -
Export Journal Feature - Building SaaS #191
In this episode, I started with cleaning up a few small items. After those warmups, we moved on to building an export feature that will allow users to take their journal entries if they want to leave the service. -
Export Journal Feature - Building SaaS with Python and Django #191
In this episode, I started with cleaning up a few small items. After those warmups, we moved on to building an export feature that will allow users to take their journal entries if they want to leave the service. -
Weeknotes (2024 week 21)
Weeknotes (2024 week 21)There have been times when work has been more enjoyable than in the last few weeks. It feels more stressful than at other times, and this mostly has to do with particular projects. I hope I’ll be able to move on soon. blacknoise I have released blacknoise 1.0. It’s an ASGI app for static file serving inspired by whitenoise. The 1.0 version number is only a big step in versioning terms, not much has happened with the code. It’s a tiny little well working piece of software which has been running in production for some time without any hickups. The biggest recent change is that I have parallelized the gzip and brotli compression step; this makes building images using whitenoise more painful because there the wait is really really long sometimes. A pull request fixing this exists, but it hasn’t moved forwards in months. I have written a longer post about it earlier this year here. Releases feincms3-cookiecontrol 1.5: Code golfing. Added backwards compatibility with old Django versions so that I can use it for old projects. Also includes optional support for Google consent management. django-fast-export 0.1.1: This is basically a repackaging of the streaming CSV view … -
Django News - Django Developers Survey 2023 Results - May 17th 2024
News Django Developers Survey 2023 Results The DSF is excited to share the results of last fall's Django Developers Survey, using detailed infographics to highlight how the community influences the future of web development. djangoproject.com pip 24.1 betas -- help us test a major upcoming change! The pip team has released pip 24.1b1, which contains a lot of significant improvements and bug fixes. pradyunsg.me Updates to Django Today 'Updates to Django' is presented by Raffaella Suardini from Djangonaut Space! Last week we had 14 pull requests merged into Django by 11 different contributors - including 3 first-time contributors! Congratulations to Adam Zahradník, R3a9670 and Alex for having their first commits merged into Django - welcome on board! Django 5.1 Alpha & Feature Freeze on May 22: by this date, all features intended for Django 5.1 must be completed and merged otherwise they will be deferred to a future release. Call to action for testers: your efforts are crucial in helping achieve a bug-free release! For more information, check out the Django 5.1 Roadmap. Django Newsletter Sponsored Ad Try Scout APM for free! Sick of performance issues? Enter Scout's APM tool for Python apps. Easily pinpoint and fix slowdowns with intelligent … -
PyGrunn: platform engineering, a python perspective - Andrii Mishkovskyi
(One of my summaries of the 2024 Dutch PyGrunn python&friends conference in Groningen, NL). There's no universally accepted definition of platform engineering. But there are some big reasons to do it. "Shift left" is a trend: a shift from pure development into more parts of the full process, like quality assurance and deployment. But... then you have an abundance of choice. What tools are you going to use for package management? Which CI program? How are you going to deploy? There are so many choices... Jenkins or github actions or gitlab? Setuptools or poetry? Etcetera. You have lots of choices: hurray! Freedom! But it takes a huge amount of time to make the choice. To figure out how to use it. To get others to use it. There of course is a need to consolidate: you can't just support everything. How do you do platform engineering? You observe. Observation: you need to be part of a community where you gather ideas and tips and possible projects you can use. You execute. Execute: you have to actually set things up or implement ideas. You collect feedback. Talk with your colleagues, see how they're using it. You really have to be open … -
PyGrunn: unifying django APIs through GraphQL - Jeroen Stoker
(One of my summaries of the 2024 Dutch PyGrunn python&friends conference in Groningen, NL). He works on a big monolythical django application. It started with one regular django app. Then a second app was added. And a third one. The UI was templates with a bit of javascript/jquery. Then a REST api was added with djangorestframework and a single page app in backbone or react. Then another rest api was added. With another rest api library. In the end, it becomes quite messy. Lots of different APIs. Perhaps one has a certain attribute and another version doesn't have it. And the documentation is probably spread all over the place. REST APIs have problems of their own. Overfetching and underfetching are the most common. Underfetching is when you have to do multiple requests to get the info you need. Overfetching is when you get a big blob of data and only need a little part of it. Then.... a new frontend app had to be build. He wanted to spend less time on defining endpoionts/serializers. And to re-use existing functionality as much as possible. At a previous pygrunn, https://graphql.org/ was suggested. What is graphql? Query language for APIs. Defined with a … -
PyGrunn: descriptors, decoding the magic - Alex Dijkstra
(One of my summaries of the 2024 Dutch PyGrunn python&friends conference in Groningen, NL). "Descriptors" are re-usable @property-like items. They implement the __get__, __set__ and __delete__ methods and possibly the __set_name__ method. See https://docs.python.org/3/howto/descriptor.html for an introduction on the python website. Most of the talk consisted of code examples: I'm not that fast a typer :-) So this summary is mostly a note to myself to check it out deeper. You can use them for custom checks on class attributes, for instance. Or for some security checks. Or for logging when an attribute is updated. This is how it looks when you use it: class Something: id = PositiveInteger() # <= this is your descriptor So usage of a descriptor is easy. The hard and tricky part is actually writing them. If you don't really need them: don't try to write them. If you write code that is used a lot, the extra effort might pay off. A funny one was an Alias descriptor: class Something: name: str full_name = Alias("name") nickname = Alias("name") something = Something() something.name = "pietje" something.name # Returns pietje something.full_name # Returns pietje, too something.nickname # Returns pietje, too -
Settings and Billing Portal - Building SaaS #190
In this episode, I worked on the settings page for the user. This was a vital addition because it allows users to access the Stripe billing portal and close their account if they no longer wish to use JourneyInbox. -
Settings and Billing Portal - Building SaaS with Python and Django #190
In this episode, I worked on the settings page for the user. This was a vital addition because it allows users to access the Stripe billing portal and close their account if they no longer wish to use JourneyInbox. -
Funding Open Source - Jeff Triplett
Jeff’s personal site and microblogRevSysuvDjangoCon Europe 2023: Yak-shaving to Where the Puck is Going to Be by Carlton Gibsondjango-vanilla-viewsneapoloitandjango-template-partialsDjango PackagesDjango Jobsawesome-django20 Django Packages That I Use in Every ProjectDjango Interview QuestionsSponsorMailtrap.io -
Django Technical Interview Questions
The technical interview is a dreaded but necessary part of landing a programming job, in this case, for web development with Django. It's important to understand that you are already … -
Django News - Django 5.0.6 released - May 10th 2024
News Django bugfix releases issued: 5.0.6 and 4.2.13 Django 5.0.6 and 4.2.13 are re-issued from Django 5.0.5 and 4.2.13 and are both bugfix additions. djangoproject.com Python 3.13.0 beta 1 released Python 3.13.0 beta 1 is the first of four beta release previews of Python 3.13. blogspot.com PSF News: PSF Board Election Dates for 2024 PSF Board elections are a chance for the community to choose representatives to help the PSF create a vision for and build the future of the Python community. This year, there are three seats open on the PSF board. blogspot.com 2023 PSF Annual Impact Report A 28-page visual report of the Python Software Foundation's actions in 2023. python.org Updates to Django Today 'Updates to Django' is presented by Raffaella Suardini from Djangonaut Space! Last week we had 14 pull requests merged into Django by 9 different contributors - including 1 first-time contributor! Congratulations to Shamil for having their first commit merged into Django - welcome on board! Bugs fixed in Django 5.0: Fixed a bug that caused a migration crash when changing a GeneratedField while renaming a field. Also addressed an issue where adding a GeneratedField before its referenced fields caused migration crashes. In Django 5.1, … -
Weeknotes (2024 week 18)
Weeknotes (2024 week 18)Google Summer of Code has begun We have a student helping out with adding async support to the Django Debug Toolbar. It’s great that someone can spend some concentrated time to work on this. Tim and others have done all the necessary preparation work, I’m only helping from the sidelines so don’t thank me. Bike to Work Two teams from my company are participating in the Bike to Work Challenge 2024. It’s what I do anyway (if I’m not working from home) but maybe it helps build others some motivation to get on the bicycle once more. Public transports in the city where I live are great but I’ll always take the bike when I can. I also went on my first mountain bike ride in a few months yesterday, good fun. JSON blobs and referential integrity The django-json-schema-editor has gained support for referencing Django models. Here’s an example schema excerpt: { ... "articles": { "type": "array", "format": "table", "title": _("articles"), "minItems": 1, "maxItems": 3, "items": { "type": "string", "title": _("article"), "format": "foreign_key", "options": { "url": "/admin/articles/article/?_popup=1&_to_field=id", }, }, }, ... } The ID field is stringly typed; using an integer directly wouldn’t work because the empty … -
Django News - New Django Ops Team Member - May 3rd 2024
News June 2024 marks 10 incredible years of Django Girls magic! 🥳✨ Join the celebration as Django Girls turns 10 🎉 and share your experiences in our survey! djangoproject.com DEFNA: Board Member Update for May 2024 Velda Kiara joins the DEFNA board, and we wish Jennifer Myers a heartfelt thank you for three years of service. defna.org Django Software Foundation Welcome our new OPS member - Baptiste Mispelon The DSF Board is pleased to introduce Baptiste Mispelon as a new member of the Ops team that maintains Django’s infrastructure. djangoproject.com Updates to Django Today 'Updates to Django' is presented by Velda Kiara from Djangonaut Space! Last week we had 11 pull requests merged into Django by 10 different contributors - including 5 first-time contributors! Congratulations to Chris Muthig, Saurabh , James Ostrander, Tim Richardson, and Cole D for having their first commits merged into Django - welcome on board! Django 5.0.5 got a bug fix. You can now import aprefetch_related_objects from django.db.models Djangonaut Space Session 2 is still open and accepting applications. Read more about it here and apply. Django Newsletter Wagtail CMS Get even more organized with Wagtail 6.1 An overview of what's new in Wagtail 6.1. wagtail.org How … -
Building Reusable Components in Django
This tutorial looks at how to build server-side UI components in Django.