Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
CI/CD Github Workflow for Django & DigitalOcean App Platform
Whenever you aim to release co... -
AI Model Download Pipeline
In [Build a Spam Classifier](h... -
Build a Spam Classifier with Keras
With deep learning and AI, han... -
Push Secure Directories with Encryption Pipelines
In the [Ai as an API](https://... -
Django Static Files in Production on DigitalOcean Spaces
In this post, we'll use Digita... -
Django on Docker
As you may know, Django is a w... -
Django & Github Actions
Github actions is an amazing w... -
A Python JWT Client for Django Rest Framework simplejwt
In this blog post, we'll look ... -
Download the MovieLens Dataset with Python
In our [Django & Machine Learn... -
You Can Build Portable Binaries of Python Applications
Contrary to popular belief, it’s possible to ship portable executables of Python applications without sending its users to Python packaging hell. -
Using Hypothesis and Schemathesis to Test FastAPI
This article looks at how property-based testing via Hypothesis and Schemathesis can be used to test FastAPI. -
Programmatically render a NextJS page without a server in Node
If you use getServerSideProps() in Next you can render a page by visiting it. E.g. GET http://localhost:3000/mypages/page1 Or if you use getStaticProps() with getStaticPaths(), you can use npm run build to generate the HTML file (e.g. .next/server/pages directory). But what if you don't want to start a server. What if you have a particular page/URL in mind that you want to generate but without starting a server and sending an HTTP GET request to it? This blog post shows a way to do this with a plain Node script. Here's a solution to programmatically render a page: #!/usr/bin/env node import http from "http"; import next from "next"; async function main(uris) { const nextApp = next({}); const nextHandleRequest = nextApp.getRequestHandler(); await nextApp.prepare(); const htmls = Object.fromEntries( await Promise.all( uris.map((uri) => { try { // If it's a fully qualified URL, make it its pathname uri = new URL(uri).pathname; } catch {} return renderPage(nextHandleRequest, uri); }) ) ); console.log(htmls); } async function renderPage(handler, url) { const req = new http.IncomingMessage(null); const res = new http.ServerResponse(req); req.method = "GET"; req.url = url; req.path = url; req.cookies = {}; req.headers = {}; await handler(req, res); if (res.statusCode !== 200) { throw new Error(`${res.statusCode} on … -
Continuously Deploying Django to Linode with Docker and GitHub Actions
In this tutorial, we'll look at how to configure GitHub Actions to continuously deploy a Django and Docker application to Linode. -
Django News - Wagtail 4.0 released - Sep 2nd 2022
News Wagtail 4.0 released A quick tour of Wagtail 4.0 demoing new features around creating and managing content. See the full release notes as well. wagtail.org Top Programming Languages 2022 - IEEE Spectrum Python’s still No. 1. ieee.org django-developers #21978 on inclusion of a production-ready web server Updated discussion around an old ticket to include a production-ready web server in Django. google.com Sponsored Ad Wagtail CMS in Action Discount! Wagtail CMS in Action is a fun guide to building websites with Wagtail, a content management system based on Python and Django, brought to you by Kalob Taulien, a core member of the Wagtail development team. Here is a 30% off discount code!: nldjangonws22 mng.bz Events Everything you need to know about DjangoCon US 2022 This week the DjangoCon US organizers, including Jeff, recorded a Twitter Space to help get the word out about the return of DjangoCon US to their first in-person/hybrid event since 2019. twitter.com DjangoCon US 2022 Discounted Tickets! The DjangoCon US team would like to give our readers a 10% off discount code, good for in-person, online, and even tutorials! ti.to Articles Google Summer of Code - Blog 2 Deepak Dinesh is a Google Summer of Code … -
flake8-bugbear - Building SaaS with Python and Django #143
In this episode, I updated my app to use flake8-bugbear. I fixed the issues that popped up and talked about strategies to manage adding new tools. -
flake8-bugbear - Building SaaS #143
In this episode, I updated my app to use flake8-bugbear. I fixed the issues that popped up and talked about strategies to manage adding new tools. -
Django @Instagram - Carl Meyer (Ep78 Replay)
OddBirdDjango @ Instagram - Django Under the Hood 2016Testing & Django - PyCon 2012PyCon 2017 Keynote - Road to Python 3 at InstagramPython at Scale: Strict ModulesSupport 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. -
Django Favicon Guide
In this tutorial, I will talk about the two solutions to add Favicon to your Django project. -
Django News - Heroku Eliminates Free Tiers - Aug 26th 2022
News 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 #142
In 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 #142
In 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 Python
Use `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 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 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 Software
Managing 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 2022
News 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 …