Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
- 
        Django News - Heroku Eliminates Free Tiers - Aug 26th 2022News Heroku Eliminating Free Tiers Starting October 26, 2022 Heroku will begin deleting inactivate accounts and starting November 28, 2022 will stop offering free plans all together. heroku.com Sponsored Ad Crunchy Bridge - Fully Managed Postgres as a Service crunchybridge.com Events Development Sprints: What are they & why should I attend? DjangoCon US breaks down what development sprints are and encourages you to attend. djangocon.us Articles Learn Postgres at the Playground A place for devs to polish their Postgres skills, this is a web-based Postgres playground with canned datasets to load and guided tutorials to learn about the power of Postgres. crunchydata.com The best way to find performance bottlenecks: observing production A checklist guide to solving performance bottlenecks in production. pythonspeed.com Django: How to let user download a file A look at how to let users download ImageField or FileField content. nemecek.be Use One Big Server - Speculative Branches A detailed argument in favor of one big server vs competing web architecture approaches. specbranch.com Use partial() With Django’s transaction.on_commit() to Avoid Late-Binding Bugs Django’s transaction.on_commit() allows you to run a function after the current database transaction is committed. This is useful to ensure that actions with external services, like sending …
- 
        Finish Teacher Checklist - Building SaaS with Python and Django #142In this episode, we finished off the teacher checklist feature in the homeschool app. I tied together all the loose ends, checked the feature end to end, and wrote the unit tests to complete the whole effort.
- 
        Finish Teacher Checklist - Building SaaS #142In this episode, we finished off the teacher checklist feature in the homeschool app. I tied together all the loose ends, checked the feature end to end, and wrote the unit tests to complete the whole effort.
- 
        Join a list with a bitwise or operator in PythonUse `functools.reduce(operators.or_, my_list)` to join `my_list` with a bitwise OR.
- 
        Use partial() With Django’s transaction.on_commit() to Avoid Late-Binding BugsDjango’s transaction.on_commit() allows you to run a function after the current database transaction is committed. This is useful to ensure that actions with external services, like sending emails, don’t run until the relevant data is definitely saved. Although Django’s documentation says that on_commit() takes a “function”, you can pass it any callable. Python’s flexibility means that functions are not the only callable type, but also classes, and other kinds of objects. (Trey Hunner has a great introduction to this concept.) In this post we’ll look at using four techniques for passing callables to on_commit(), and how the last one (with partial) protects against a potential late-binding bug. We’ll also see how you can check for this bug with flake8-bugbear. 1. A Plain Function This is the first techinque covered by the Django documentation, and perhaps the easiest to understand. For example, imagine we were writing a function to grant a user a reward and email them. To send the email after the reward is saved in the database, we can create an inner function, and pass that to transaction.on_commit(): from django.db import transaction ... def grant_reward(amount: Decimal, user: User) -> None: Reward.objects.create(user=user, amount=amount) def notify_user() -> None: send_mail( subject=f"You have …
- 
        Managing complexity and technical debt by releasing Open Source SoftwareManaging complexity and technical debt by releasing Open Source Software When working on projects for our clients I often try to keep as much code as possible in third party packages; I often even create packages for Django apps even when I do not expect to use the code in more than one project at all. One of those packages (which, in the meantime has been used more than once is django-spark). At first sight it looks like more work to package, document and test the solution. Defining boundaries is also much harder when there are many packages involved – it’s not possible to just add a hack at the right place. You have to define extension points or hooks or you have to design a library which can be used in various ways – there’s not really a way around that when moving code into open source packages. It isn’t the case that this approach necessarily means more work though, neither in the initial project nor during maintenance. Here’s a list of reasons why that is: Once the logical units of functionality are identified separating them is relatively straightforward. Tricky pieces of code can be isolated, documented and tested …
- 
        Django News - Understanding Async Python & Django - Aug 19th 2022News Holding PyCon US 2023 in Salt Lake City, UT The PSF clarified their policy for picking locations for future PyCon US and how they are booked three to four years before the event. blogspot.com Sponsored Ad Save hundreds of hours on building an admin panel for your Django project From a simple admin panel on top of your Django project to a comprehensive business tool for your most critical workflows - generate, customize and scale your dream internal tool with Forest Admin. forestadmin.com Articles Understanding async Python for the web A deep dive on async Python and how it relates to Django's continually expanding support for it. b-list.org Full-text search in Django with PostgreSQL A classic reference on full-text search in Django with PostgreSQL. paulox.net Django and OpenAPI: Front end the better way. An opinionated guide to working with Django APIs and JavaScript frontends. saaspegasus.com Where to learn Django with htmx in 2022 A curated list of free text and video guides to learning htmx + Django. hashnode.dev Podcasts Django's Async Future w/ Tom Christie (Ep46 Replay) Tom is the creator of Django REST Framework, HTTPX, and a whole suite of new async Python web stack packages. djangochat.com Sponsored …
- 
        Configuring Django backends using speckenv’s 12factor supportConfiguring Django backends using speckenv’s 12factor support There are many many 12factor utility apps available to configure databases, caches and the email backend in Django apps, for example dj-database-url, django-cache-url and dj-email-url. As I wrote in my 2020 blog post Using environment variables to configure Django I liked using them – a lot. However, this has changed a bit because I don’t like the fact that all released versions of those libraries modify the urllib.uses_netloc list with their own protocols (when it’s not necessary at all) and I don’t like it either that some bugs still exist in some libraries which make upgrading projects in our environments from Django 3.2 to Django 4.0 harder than it should be; the problem isn’t really caused by Django’s new built-in features but rather surfaced by it. Anyway, since I already had a library which helped reading settings from the environment, adding another utility which transforms DSNs to configuration dictionaries understood by Django was straightforward. And that’s why I’m now happily using speckenv’s Django support for those use cases. Reducing the amount of dependencies in a project maybe shouldn’t be a goal in itself, but replacing generic utilities with more opinionated utilities is certainly …
- 
        Easier Crediting of Contributors on GitHubGit has the concept of co-authors of a commit. You’ve probably seen it in the web UI, when multiple people are listed to have committed something. I want to be gracious with credit where it’s due and I’ve found ways to make it easier.
- 
        Teacher Checklist Editing - Building SaaS with Python and Django #141In this episode, I returned to the teacher checklist feature and started work on the edit page that will allow users to customize what they see on the checklist.
- 
        Teacher Checklist Editing - Building SaaS #141In this episode, I returned to the teacher checklist feature and started work on the edit page that will allow users to customize what they see on the checklist.
- 
        Django's Async Future - Tom Christie (Ep46 Replay)Tom Christie personal siteEncodeDjangoCon Europe 2019 - Sketching out a Django redesignDjangoCon US 2019 - Just Add Await: Retrofitting Async into DjangoDjango REST FrameworkMkDocsmkautodocHTTPXurllib3Starlettehostedapi - demo app built with StarletteSupport the ShowThis podcast does not have any ads or sponsors. To support the show, please consider purchasing a book, signing up for Button, or reading the Django News newsletter.
- 
        Generating XLSX (or CSV) from the Django admin (or elsewhere)Generating XLSX (or CSV) from the Django admin (or elsewhere) The blog post Django: excel output instead of csv inspired me to write about my own experience with XLSX or CSV generation. XLSX export For a long time I used similarly structured ad-hoc code built on xlwt, a project which looks abandoned these days. I have been a more or less happy user of openpyxl during the last years and intend to continue using it. Something which I (or rather my users) require often is a way to export a list of selected objects from the Django admin. A good way to achieve this is by using an admin action. The common use case is that I have to export all model fields and maybe some additional data. xlsxdocument makes this very easy, all you have to do is: from django.contrib import admin from xlsxdocument import export_selected from app import models @admin.register(models.Example) class ExampleAdmin(admin.ModelAdmin): actions = [export_selected] If you wanted more control and wanted to add an additional field at the end you could write your own view (or embed the code in your own action, see the Django docs for this): from xlsxdocument import export_selected from app.models import Example …
- 
        Understanding async Python for the webRecently Django 4.1 was released, and the thing most people seem interested in is the expanded async support. Meanwhile, for the last couple years the Python web ecosystem as a whole has been seeing new frameworks pop up which are fully async, or support going fully async, from the start. But this raises a lot of questions, like: just what is “async” Python? Why do people care about it so much? And is it really … Read full entry
- 
        Django: excel output instead of csvTen years ago I made a time registration system for our company. Yeah, I know. Time registration systems are what everybody writes just for themselves instead of using one of the existing ones. Custom wishes: the same old excuses :-) But it was good fun to build and still is. At that time it was becoming popular to build the frontend in javascript. So I build it with pure, unashamed django templates. Custom template tags for formatting; formsets; the whole hog. After ten years, the website is still in heavy use, with only minimal work needed. Well, a bit too minimal: recently I really had to update the site as it was still running on python 3.5 and django 1.8. As it was pretty standard django, updating wasn't that hard. (I gave a talk about upgrading old django websites with docker recently, which might be interesting). The old CSV export Such a time registration system needs to output reports. Lots of different reports. I picked plain *.csv for that, as at the time there wasn't a handy xls exporter yet. The best one at the time needed you to install openoffice on the webserver, which wasn't ideal. Probably due to …
- 
        Django News - DjangoCongress JP 2022 Call For Proposals - Aug 12th 2022News PostgreSQL: PostgreSQL 14.5, 13.8, 12.12, 11.17, 10.22, and 15 Beta 3 Released! The PostgreSQL Global Development Group has released an update to all supported versions of PostgreSQL, including 14.5, 13.8, 12.12, 11.17, and 10.22, as well as the third beta release of PostgreSQL 15. postgresql.org Sponsored Ad Django GDPR Cookie Consent Highly customizable Django app to make your Django website compatible with GDPR Cookie law. gumroad.com Events DjangoCongress JP 2022 Call For Proposals (last call) DjangoCongress JP 2022 is on Saturday, November 12th, and their CFP is Friday, August 12th. google.com Articles How To Add a Text Editor To A Django Blog With Summernote Quickly add a powerful text editor to a Django blog app with Summernote. ctrlzblog.com How to find the number of items on the ORM queue using Django-Q A quick guide to exploring an ORM queue with the powerful Django-Q third-party package. djangoandy.com Class-based vs Function-based Views in Django A thorough article looking at the differences between Django's class-based views (CBV) and function-based views (FBV). testdriven.io Tutorials Integrating Mailchimp with Django A look at how to integrate Mailchimp with Django in order to handle newsletter subscriptions and send transactional emails. testdriven.io Videos Django-Sesame - Magic URLs …
- 
        pip-tools Supports pyproject.tomlpip-tools is ready for modern packaging.
- 
        Taking notes in interviewsShort summary for the index page here.
- 
        Integrating Mailchimp with DjangoThis article looks at how to integrate Mailchimp with Django for newsletters and transactional emails.
- 
        Imageview customization (circular image view)In android designing we'll come across ImageView. An ImageView displays an arbitrary image, such as an icon. The ImageView class can load images from various sources (such as resources or content providers), takes care of computing its measurement from the image so that it can be used in any layout manager, and provides various display options such as scaling and tinting. it is recommended to customise it through bitmaps(BitMap in android) instead of reshaping the image manually.
- 
        7 Mistakes to Avoid while Building a Mobile Application in 2021Mobile application development, the developers create many applications everyday, but not all apps are appreciated.7 mistakes to avoid in app development.
- 
        Django Template Language IntroWe can write the required logics based on programming[python] syntax in models and views but, when we want to write simple logics we should follow the django's template syntax, because programming[python] syntax is not allowed.
- 
        Django News - Django 4.1 Released - Aug 5th 2022News Django 4.1 released!!! The release notes cover the profusion of new features in detail, but a few highlights are: An async interface to the ORM, and the ability to define async handlers on class-based views. The use of ORM-defined database constraints in model validation. Better form rendering accessibility and output style customization. djangoproject.com Django security releases issued: 4.0.7 and 3.2.15 This release fixes a file download vulnerability in FileResponse. We encourage all users of Django to upgrade as soon as possible. djangoproject.com Python 3.10.6 is available Python 3.10.6 is the newest major release of the Python programming language, and it contains many new features and optimizations. blogspot.com Sponsored Ad Django for Beginners/APIs/Professionals Level up your Django knowledge with Django for Beginners, Django for APIs, or Django for Professionals. Sample chapters are available to preview for free. learndjango.com Articles How to Combine Frontend and Backend (For Python Web Developers) A look at six different ways to combine back-end and front-end for Python developers with an analysis of the pros and cons for each approach. accordbox.com Django and SQL: Your Dynamic Duo for Scaling Databases An overview of managed hosting services for SQL, Redis, and other services. linode.com How to use …
- 
        Django 4.1 Preview - Jeff Triplett (Ep 115 Replay)Django 4.1 releasedJeff Triplett personal siteDjangoCon US Call for ProposalsDjango News newsletterawesome-djangoDjango for Professionals 4.0 UpdateDjangoX starter projectSupport the ShowThis podcast does not have any ads or sponsors. To support the show, please consider purchasing a book, signing up for Button, or reading the Django News newsletter.
- 
        How to Combine Frontend and Backend (For Python Web Developers)After reading, you will know the six solutions to combine the frontend and backend, and the pros and cons.