Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django News - Happy Django New Year! - Dec 30th 2022
News Python Software Foundation - December 2022 Newsletter In case you missed the PSF's December Newsletter, you might want to check it out to see what is the latest information about what is going on with the PSF and PyCon US 2023. mailchi.mp Articles Electron + Django, desktop app integrate JavaScript & Python Learn how to build a desktop app with Electron and Django in this two-part article. The Django application runs while the desktop app is running. dev.to Making pip installs a little less slow Some valuable advice for speeding up pip install both inside and outside of containers. pythonspeed.com Sponsored Link REVSYS We can help you with your project as experienced Django developers and consultants. Follow our open-source projects on GitHub at https://github.com/revsys to see what we're working on and how we can support you. github.com Events PyCon Italia: Call For Proposals You have until January 15th, 2023, AoE, to submit your talk to PyCon Italia 2023! pycon.it Tutorials Introduction to Custom Actions and Bulk Actions in Django Learn how to add custom and bulk actions to the Django admin dashboard in this tutorial. dev.to Build a fast search UI with Meilisearch, HTMX and Django Learn how to … -
Django News - Celebrate the Holiday Season with Django - Dec 23rd 2022
News PSF: More Python Everywhere, All at Once: Looking Forward to 2023 The Python Software Foundation (PSF) needs donations to support education and outreach initiatives in addition to its existing efforts to organize PyCon US and provide funding for smaller Python events and maintain critical infrastructure for Python users. blogspot.com Articles Boring Python: code quality The second post in a series describes how to build, deploy, and manage Python applications in a "boring" and efficient way. b-list.org Django API Domains This styleguide combines domain-driven design principles and Django's apps pattern to provide a pragmatic guide for developing scalable API services with the Django web framework. github.io Django Email/Contact Form Tutorial William Vincent shows us how to create a simple contact form to send Django emails with SendGrid. learndjango.com Forum Why do we need apps? A very interesting and lengthy discussion over at the official Django Forum on apps and their place in Django projects. djangoproject.com Top 5 3rd party packages An older Django Forum thread but still relevant discussing essential 3rd party packages. djangoproject.com Sponsored Ad Django for Beginners/APIs/Professionals Bundle Deal! Great Last Minute Gift! Buy all three for $20 off! Level up your Django knowledge with Django for Beginners, … -
Django LMS - Sheena O'Connell
Umuzi DjangoCon US 2022 Talk: Building a dev-focused learner management system with Django Umuzu on GitHubEleventySupport 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. -
Boring Python: code quality
This is the second in a series of posts I intend to write about how to build, deploy, and manage Python applications in as boring a way as possible. In the first post in the series I gave a definition of what I mean by “boring”, and it’s worth revisiting: I don’t mean “reliable” or “bug-free” or “no incidents”. While there is some overlap, and some of the things I’ll be recommending can help to reduce … Read full entry -
Django News - Migrations, Playwright, More DjangoCon US Talks - Dec 16th 2022
News 2023 Term Python Steering Council Election Results The results of the 2023 Python Steering Council election are in, and the top five vote-getters are Pablo Galindo Salgado, Gregory P. Smith, Emily Morehouse, Brett Cannon, and Thomas Wouters. python.org Sponsored Ad Django for Beginners/APIs/Professionals Bundle Deal! Buy all three for $20 off! Level up your Django knowledge with Django for Beginners, Django for APIs, or Django for Professionals of gift it to a friend. Sample chapters are available to preview for free. learndjango.com Events PyTexas 2023 CFP The PyTexas conference is now accepting proposals for talks and tutorials to be presented at the conference on April 1 & 2, 2023. pretalx.com Articles Save models with update_fields for better performance in Django An interesting TIL on using update_fields to generate leaner underlying SQL. Probably not advised in most cases but a good learning example. github.io Migrations Of Madness The django-migration-snapshots package allows users to create and manage migration snapshots. This article provides an introduction to the package and explains how to use it. dev.to Running Playwright inside Docker containers Learn how to run Playwright in headed mode to interact with the browser’s user interface from outside Docker containers. oddbird.net Django for … -
Deploying a Django App to Render
This tutorial looks at how to deploy a Django application to Render. -
Django Email/Contact Form Tutorial
Let's build a simple contact form that sends email for a Django 4.1 website. We can take advantage of Django's built-in [email support](https://docs.djangoproject.com/en/dev/topics/email/) to make this relatively painless and then … -
How to change the current query string URL in NextJS v13 with next/navigation
At the time of writing, I don't know if this is the optimal way, but after some trial and error, I got it working. This example demonstrates a hook that gives you the current value of the ?view=... (or a default) and a function you can call to change it so that ?view=before becomes ?view=after. In NextJS v13 with the pages directory: import { useRouter } from "next/router"; export function useNamesView() { const KEY = "view"; const DEFAULT_NAMES_VIEW = "buttons"; const router = useRouter(); let namesView: Options = DEFAULT_NAMES_VIEW; const raw = router.query[KEY]; const value = Array.isArray(raw) ? raw[0] : raw; if (value === "buttons" || value === "table") { namesView = value; } function setNamesView(value: Options) { const [asPathRoot, asPathQuery = ""] = router.asPath.split("?"); const params = new URLSearchParams(asPathQuery); params.set(KEY, value); const asPath = `${asPathRoot}?${params.toString()}`; router.replace(asPath, asPath, { shallow: true }); } return { namesView, setNamesView }; } In NextJS v13 with the app directory. import { useRouter, useSearchParams, usePathname } from "next/navigation"; type Options = "buttons" | "table"; export function useNamesView() { const KEY = "view"; const DEFAULT_NAMES_VIEW = "buttons"; const router = useRouter(); const searchParams = useSearchParams(); const pathname = usePathname(); let namesView: Options = DEFAULT_NAMES_VIEW; const … -
Django News - Django 4.1.4 bugfix release - Dec 9th 2022
News Django bugfix release: 4.1.4 A new bugfix for 5 issues in Django 4.1.3. djangoproject.com DjangoCon US and Europe 2022 Talks Available Online The complete playlists of talks from each conference are now available on YouTube. djangoproject.com Python 3.11.1, 3.10.9, 3.9.16, 3.8.16, 3.7.16, and 3.12.0 alpha 3 are now available New Python releases are available! python.org PSF News: Introducing a New Sliding Scale Membership The Python Software Foundation (PSF) has made a sliding scale option available for Supporting Membership to make membership more accessible and increase the size and diversity of the voting membership. New Supporting Members can join the PSF for as little as $25. blogspot.com Sponsored Ad Django Hosting by CodeRed Cloud At CodeRed, we’re striving to build the world’s easiest Django hosting platform. Go from polls tutorial to production in just a few minutes. Get started with a free account which includes a MariaDB or Postgres database, static + media hosting, and everything you need to run a Django site. No AWS, S3, Docker, or 3rd-party services required! codered.cloud Events PyCon US 2023 Registration Launch! Registration for PyConUS 2023 is OPEN! The first 500 tickets sold are discounted. blogspot.com Articles Docker compose with Django 4, Celery, Redis … -
How to Get Hired as a Django Developer
Hiring developers is a famously non-linear problem. Once you have a job at a notable company, it seems recruiters constantly beat down your door. But how do you get started? … -
Django Sitemap Tutorial
A vital part of modern SEO (Search Engine Optimization) is to have a sitemap, an XML file that tells a search engine how often a page is updated and how … -
Command Line for Beginners
The _command line_ is a powerful text-only interface for computers. If you have ever seen a show where hackers are furiously typing into a black window, that's the command line. … -
Trailing URL Slashes in Django
Among Django's many built-in features is [APPEND_SLASH](https://docs.djangoproject.com/en/4.0/ref/settings/#append-slash), which by default is set to `True` and automatically appends a slash `/` to URLs that would otherwise [404](https://en.wikipedia.org/wiki/HTTP_404). **Note**: The Chrome web … -
What is Django (Python)?
[Django](https://djangoproject.com) is an open-source web framework written in the [Python](https://www.python.org) programming language. Named after the jazz guitarist [Django Reinhardt](https://en.wikipedia.org/wiki/Django_Reinhardt), it is used by some of the largest websites in the … -
What's New in Django 3.1
Django 3.1 will be released in early August 2020 and comes a number of major new features and many minor improvements including asychnronous views and middleware support, asynchronous tests, JSONField … -
Django Best Practices: Custom User Model
Django ships with a built-in [User model](https://docs.djangoproject.com/en/4.0/ref/contrib/auth/#django.contrib.auth.models.User) for authentication and if you'd like a basic tutorial on how to implement log in, log out, sign up and so on see … -
How to Get Hired as a Django Developer
Hiring developers is a famously non-linear problem. Once you have a job at a notable company, it seems recruiters constantly beat down your door. But how do you get started? … -
NameError: name 'os' is not defined
If you've started a new Django 3.1+ project and are using older tutorials or guides, it's likely to come across the following error on your command line: ``` NameError: name … -
Django Polls Tutorial API
The [polls tutorial](https://docs.djangoproject.com/en/dev/intro/tutorial01/) is the official guide to Django. As a fun exercise, I wanted to show how little code it takes to transform it into a robust API using … -
Flask vs Django (2022)
[Flask](https://palletsprojects.com/p/flask/) and [Django](https://www.djangoproject.com) are the two most popular [Python-based](https://www.python.org) web frameworks. Both are mature, open-source, and have many happy users. A natural question therefore is: which one to use? In … -
Postgres - Craig Kerstiens
Craig's Personal websiteCrunchy DataUnfinished Business with PostgresCrunchy Bridge's Ruby Backend: Sorbet, Tapioca, and Parlour-Generated Type StubsPostgres PlaygroundPostgres WeeklySupport 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 much faster is Cheerio at parsing depending on xmlMode?
Cheerio is a fantastic Node library for parsing HTML and then being able to manipulate and serialize it. But you can also just use it for parsing HTML and plucking out what you need. We use that to prepare the text that goes into our search index for our site. It basically works like this: const body = await getBody('http://localhost:4002' + eachPage.path) const $ = cheerio.load(body) const title = $('h1').text() const intro = $('p.intro').text() ... But it hit me, can we speed that up? cheerio actually ships with two different parsers: parse5 htmlparser2 One is faster and one is more strict. But I wanted to see this in a real-world example. So I made two runs where I used: const $ = cheerio.load(body) in one run, and: const $ = cheerio.load(body, { xmlMode: true }) in another. After having parsed 1,635 pages of HTML of various sizes the results are: FILE: load.txt MEAN: 13.19457640586797 MEDIAN: 10.5975 FILE: load-xmlmode.txt MEAN: 3.9020372860635697 MEDIAN: 3.1020000000000003 So, using {xmlMode:true} leads to roughly a 3x speedup. I think it pretty much confirms the original benchmark, but now I know based on a real application. -
Django News - 2022 Malcolm Tredinnick Memorial Prize awarded to Paolo Melchiorre - Dec 2nd 2022
News 2022 Malcolm Tredinnick Memorial Prize awarded to Paolo Melchiorre The Django Software Foundation Board is pleased to announce that the 2022 Malcolm Tredinnick Memorial Prize has been awarded to Paolo Melchiorre. Check out Paolo's blog post too. djangoproject.com 2023 DSF Board Election Results There were 30 candidates this year and the election results are in for next year. djangoproject.com Sponsored Ad Django Hosting by CodeRed Cloud At CodeRed, we’re striving to build the world’s easiest Django hosting platform. Go from polls tutorial to production in just a few minutes. Get started with a free account which includes a MariaDB or Postgres database, static + media hosting, and everything you need to run a Django site. No AWS, S3, Docker, or 3rd-party services required! codered.cloud Articles Test factory functions in Django A very well done guide to test factory functions in Django, why to use them, custom factory functions, what not to do, and more. lukeplant.me.uk Django Settings Patterns to Avoid Sage advice from Adam Johonson on some potential mistakes made with Django settings that you can avoid. adamj.eu The Essential Django Deployment Guide A comprehensive overview of what it takes to get your Django app into production and the … -
Learn Python By Example - Ghost Gobble Arcade Game
Learn Python By Example shows a simple Python exercise from Exercism. This problem illustrates booleans in Python. -
Blackjack and Bugs - Building SaaS with Python and Django #151
In this episode, we started with a Python exercise on Exercism that explored Blackjack. We wrote functions that handled some of Blackjack’s core rules. After the Python exercise, we focused on a bug in the Django app that fixed an edge case with some the teacher checklist feature.