Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django News - Django security releases issued: 5.0.3, 4.2.11, and 3.2.25 - Mar 8th 2024
News Django security releases issued: 5.0.3, 4.2.11, and 3.2.25 A new security release addressing a potential regular expression denial-of-service. As always, the best security measure is to stay up-to-date with the latest version of Django. djangoproject.com Google Summer of Code 2024 Django is once again part of Google's Summer of Code. This long-running program has resulted in many key contributions to Django over the years. withgoogle.com Wagtail CMS Making wagtail.org more accessible Wagtail.org, with help from Outreachy, performed an accessibility audit and published the results. wagtail.org Sponsored Ad The Complete pytest Course: From beginner to expert From Brian Okken, author of the book, Python Testing with pytest, comes a brand-new video course on mastering pytest. pythontest.com Articles How to spend less time writing Django tests Autogenerating Django integration tests using Kolo and trace inversion. kolo.app Things I'd Like to See in a DjangoCon US 2024 Talk Drew Winstel is the Vice President of DEFNA, the group that organizes DjangoCon US every year, and the current program chair. In this piece he writes suggestions for what topics would be good in a talk. winstel.dev DjangoCon US 2024 Topics Inspiration List Kati is a DEFNA Director and presents a very thorough list … -
Do It Live - Building SaaS #185
In this episode, we deployed all our user setup and Stripe configuration change to the live site and tested the new flows end to end. Along the way, we found a bug in djstripe as well as some final bugs in the JourneyInbox configuration that prevented things from working. This is why you test! -
Do It Live - Building SaaS with Python and Django #185
In this episode, we deployed all our user setup and Stripe configuration change to the live site and tested the new flows end to end. Along the way, we found a bug in djstripe as well as some final bugs in the JourneyInbox configuration that prevented things from working. This is why you test! -
Final Pre-live Features - Building SaaS #184
In this episode, we completed the final features needed to get the site open for others to sign up. This included some dynamic limiting of the number of people allowed to sign up. We also had to add the template styling for the login page. -
Final Pre-live Features - Building SaaS with Python and Django #184
In this episode, we completed the final features needed to get the site open for others to sign up. This included some dynamic limiting of the number of people allowed to sign up. We also had to add the template styling for the login page. -
The Future of Python - Deb Nicholson
PyCon US 2024Python Software Foundation DjangoCon US 2023: Meet-ups: A Grand Vision for a Humble Endeavor PyCon US 2023 Keynote Speaker - Deb Nicholson: Community Service Awards & Python Software Foundation Update EU’s Cyber Resilience Act Passes with Wins for Open Source Announcing the Deputy Developer in Residence and the Supporting Developer in Residence How to become a CNAOur new comms person!Python Software Foundation Newsletter Sign-up ### Support the Show* [LearnDjango.com](http://learndjango.com)* [Button](https://btn.dev/)* [Django News newsletter](https://django-news.com) -
Django Blog Tutorial
This tutorial is a step-by-step guide to building a simple blog application using Django. If you are brand new to Django, I recommend first starting with the [Getting Started with … -
Where Does Validation Occur?
We can be more confident that our application will not break during runtime if we validate our data is of an expected size/shape/range. If we have a user account, for example, we don't want to save "larryjohnson" as an email address because when we try to email that address, the application will fail. We might want to restrict names to a reasonable character length, numbers to be only positive, or start dates to be earlier than end dates. Where Does Validation Occur? There are many places where data is validated in a frontend + DRF backend situation: The user validates what they write when they enter it, assuming they are not malicious The browser validates a field or form using HTML5's constraint validation for common use cases, assuming the correct usage of the type attribute on an input field or other validation-related attributes such as required and pattern The browser can also validate a field or form in custom situations using JavaScript The serializer validates each field on the serializer with their respective validate_(self, value) methods The serializer validates the serializer as a whole with the validate(self, attrs) method The database validates the data does not violate any database constraints … -
Django News - 28 PRs Merged into Django This Week! - Mar 1st 2024
News DjangoCon US 2024 CFP and Opportunity Grants are open! DjangoCon US 2024's Call for Proposals and Opportunity Grants programs are now open until April 24, 2024. djangocon.us PSF News: White House recommends use of memory-safe languages like Python The White House has recommended the use of memory-safe programming languages like Python. blogspot.com Updates to Django Today 'Updates to Django' is presented by Pradhvan from Djangonaut Space! Last week we had 28 pull requests merged into Django by 16 different contributors - including 4 first time contributors! Congratulations to Erin Kelly, AlexCLeduc, d9pouces, and Emmanuel Sandjio for having their first commits merged into Django - welcome on board! Exciting news in Django 5.1: The admin UI has a new feature enabling users to set unusable passwords via a checkbox named "Allow login", toggled on by default. cached_db.SessionStore now logs failures when saving content exceeding the cache backend's limit, preventing request crashes from that subsequent session. Registering URL converters with same name is deprecated in favor of enforcing uniqueness on custom path converters. Not enough? There's some pretty cool stuff packed in 5.0 too: First-time contributor AlexCLeduc fixed a bug by adding a definitive chunk_size for the queryset iterator during database … -
Django REST Framework: Pros and Cons
This article looks at the pros and cons of using Django REST Framework for building RESTful APIS with Django. -
Getting Started with Django Tutorial
This free tutorial is designed for programmers new to the Django web framework, whether you are a beginner who wants to build web applications in Python for the first time … -
Django Project on NGINX Unit
Recently, I learned about the NGINX Unit and decided to try it on my DjangoTricks website. Unit is a web server developed by people from NGINX, with pluggable support for Python (WSGI and ASGI), Ruby, Node.js, PHP, and a few other languages. I wanted to see whether it's really easy to set it up, have it locally on my Mac and the remote Ubuntu server, and try out the ASGI features of Django, allowing real-time communication. Also, I wanted to see whether Django is faster with Unit than with NGINX and Gunicorn. This article is about my findings. My observations Unit service uses HTTP requests to read and update its configuration. The configuration is a single JSON file that you can upload to the Unit service via a command line from the same computer or modify its values by keys in the JSON structure. Normally, the docs suggest using the curl command to update the configuration. However, as I am using Ansible to deploy my Django websites, I wanted to create a script I could later copy to other projects. I used Google Gemini to convert bash commands from the documentation to Ansible directives and corrected its mistakes. The trickiest … -
Django Project on NGINX Unit
Recently, I learned about the NGINX Unit and decided to try it on my DjangoTricks website. Unit is a web server developed by people from NGINX, with pluggable support for Python (WSGI and ASGI), Ruby, Node.js, PHP, and a few other languages. I wanted to see whether it's really easy to set it up, have it locally on my Mac and the remote Ubuntu server, and try out the ASGI features of Django, allowing real-time communication. Also, I wanted to see whether Django is faster with Unit than with NGINX and Gunicorn. This article is about my findings. My observations Unit service uses HTTP requests to read and update its configuration. The configuration is a single JSON file that you can upload to the Unit service via a command line from the same computer or modify its values by keys in the JSON structure. Normally, the docs suggest using the curl command to update the configuration. However, as I am using Ansible to deploy my Django websites, I wanted to create a script I could later copy to other projects. I used Google Gemini to convert bash commands from the documentation to Ansible directives and corrected its mistakes. The trickiest … -
Django News - open source funding - Feb 23rd 2024
Updates to Django Today 'Updates to Django' is presented by Raffaella Suardini from Djangonaut Space! Last week we had 15 pull requests merged into Django by 14 different contributors - including 4 first time contributors! Congratulations to Shafiya Adzhani, Cosmic Process, Moein Bbp, and Aaron Linville for having their first commits merged into Django - welcome on board! News in Django 5.1: inside OPTIONS, the option "init_command" is now supported on SQLite to specify pragma options <sqlite-init-command> upon connection. django.contrib.gis.gdal.GeometryCollection and its subclasses now support measured geometries via the new attribute .OGRGeometry.is_measured and m properties, along with the .OGRGeometry.set_measured method. In Django 5.0 a bug was fixed where filtering on foreign keys wasn't working if the field wasn't in .ModelAdmin.list_filter. It's also solved a crash involving decorators (@sensitive_variables and @sensitive_post_parameters) when loading functions from .pyc files. Django Newsletter Wagtail CMS How to make your images greener with WebP Megan makes a case to switch to WebP and shares some resources that will work with any website. wagtail.org Wagtail Space talks we'd love to see in 2024 Creative proposal ideas for Wagtail Space and beyond. wagtail.org Sponsored Ad Django and Wagtail CMS Developer Training - New Dates Live! Build your knowledge … -
Finish Stripe Integration - Building SaaS #183
In this episode, we completed the Stripe integration. I added all the necessary test code, incorporated the webhook for handling account activation, and wrote the view that Stripe needed to redirect to on successful signup. -
Finish Stripe Integration - Building SaaS with Python and Django #183
In this episode, we completed the Stripe integration. I added all the necessary test code, incorporated the webhook for handling account activation, and wrote the view that Stripe needed to redirect to on successful signup. -
GeoDjango - Harout Boujakjian and Andrew Hornstra
pinplanet - a free app to pin where you’ve beenGeoDjango docs Python Data Science Handbook KotlinKtor django-imagefield ### Support the Show* [LearnDjango.com](http://learndjango.com)* [Button](https://btn.dev/)* [Django News newsletter](https://django-news.com) -
Weeknotes (2024 week 07)
Weeknotes (2024 week 07)This is a short weeknotes entry which mainly contains a large list of releases. The reason for the large list is that I haven’t published a weeknotes entry in weeks. Releases form-designer 0.23: Only small changes, mainly updated the package for current Django and Python versions. feincms3-cookiecontrol 1.4.6: A minor change: Swallow exceptions which happen during startup when clobbering the scripts data fails. As an aside: I find it funny that I have discovered the .f3cc class in some cookie banner blocklists. It feels good to be recognized even if this maybe isn’t the nicest way, but it works for me since I actually do not like cookie banners either. At least feincms3-cookiecontrol doesn’t inject anything without users’ consent, and doesn’t require a third party service to run. django-simple-redirects 2.2.0: Minor release which adds a search field to the admin changelist. django-simple-redirects is a repackaged version of django.contrib.redirects without the django.contrib.sites dependency. speckenv 6.2: django_cache_url now supports parsing redis configuration for a leader-replica redis installation with a read-write leader host and read-only replica hosts. I use the same configuration format as django-cache-url does. django-debug-toolbar 4.3: I haven’t done much here, just some reviewing here and there. I … -
Django News - 10 Years of Wagtail - Feb 16th 2024
News Python 3.13.0 alpha 4 is now available Python 3.13 is still in development. This release, 3.13.0a4, is the fourth of six planned alpha releases. blogspot.com django-ckeditor Some notes about CKEditor 4 and how they impact the django-ckeditor package. 406.ch Django Software Foundation Django accessibility in 2023 and beyond The Django accessibility team has been up and running for three years and is now looking for new members. 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 5 first time contributors! Congratulations to Koo, bcail, shivaramkumar, Vašek Dohnal, and danigm for having their first commits merged into Django - welcome on board! Exciting news in Django 5.1: ModelAdmin.list_display now supports using __ lookups to list fields from related models. django.utils.text.Truncator used on truncatechars_html and on truncatewords_html template filter now uses html.parser.HTMLParser subclasses. This results in a more robust and faster operation Not enough? There's valuable news in 5.0: Fixed a regression in Django 5.0.2 where the intcomma template filter could return a leading comma for string representation of floats. CTA for someone with UX/UI experience: There's an … -
Django User Model talk at Django Boston Meetup
A link to the slides and thoughts on improvements for next team on this topic. -
Paying people to work on open source is good actually
If you have a problem with maintainers getting paid then you have a problem with me and I suggest you let that one marinate. -
Algorithmic Art with Python
In this talk, we’re going to start from nothing and build out our own tools for making art in Python, no AI needed! We’ll show how Python’s expressiveness allows us to describe graphics elegantly and use that to make some unique art programmatically. -
Algorithmic Art with Python
NOTE: The audio is a bit low. I did my best to boost the volume. Sorry for not dialing this in better during recording -
django-ckeditor
django-ckeditor It has finally happened. The open source version of CKEditor 4 does not contain fixes for known problems, see the CKEditor 4.24.0 LTS announcement. I totally get why the CKEditor developers did this and can only thank them for all the work that went into the editor. I wish I didn’t have to do the migration work to move basically everything to a different editor. The CKEditor 4 LTS version is only expected to be supported until the end of 2026 and I have a few projects which will be around far longer than this (or at least I hope so). Therefore, buying the LTS package would only delay the inevitable. CKEditor 5 is a completely different editor and uses the GPL license, so that’s not really an option either. TinyMCE is well known and I have been using it much earlier in my career, but reimplementing plugins isn’t fun to do. I would prefer moving everything to ProseMirror or some other structured editor, but we have so much legacy content contained in HTML blobs which do not use any schema at all that this isn’t workable unfortunately. Stay tuned for updates – they will come since I unfortunately … -
How to avoid a count query in Django if you can
Suppose you have a complex Django QuerySet query that is somewhat costly (in other words slow). And suppose you want to return: The first N results A count of the total possible results So your implementation might be something like this: def get_results(queryset, fields, size): count = queryset.count() results = [] for record in queryset.values(*fields)[:size] results.append(record) return {"count": count, "results": results} That'll work. If there are 1,234 rows in your database table that match those specific filters, what you might get back from this is: >>> results = get_results(my_queryset, ("name", "age"), 5) >>> results["count"] 1234 >>> len(results["results"]) 5 Or, if the filters would only match 3 rows in your database table: >>> results = get_results(my_queryset, ("name", "age"), 5) >>> results["count"] 3 >>> len(results["results"]) 3 Between your Python application and your database you'll see: query 1: SELECT COUNT(*) FROM my_database WHERE ... query 2: SELECT name, age FROM my_database WHERE ... LIMIT 5 The problem with this is that, in the latter case, you had to send two database queries when all you needed was one. If you knew it would only match a tiny amount of records, you could do this: def get_results(queryset, fields, size): - count = queryset.count() results …