Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Announcing a New Section: TIL
Trying out something new: today I’m launching my own Today I Learned section. In this essay I will sum up what my plans and hopes are. -
Working with AJAX in Django
This article looks at how to perform GET, POST, PUT, and DELETE AJAX requests in Django with the Fetch API and jQuery. -
A minimal Django testing style guide
You started on a MVP. Usage is increasing. The occasional bug. More users. Suddenly this MVP is not an MVP anymore. A core business process depends on this system your team is maintaining. You ship a user-reported bug fix. Users report another two. Sounds familiar? Since it was an MVP, you paid little attention to writing automated tests. What is the current codebase’s test coverage? Wait. Do you even measure it? This post is not about setting the gold standard on how to write tests for your Django application. It’s about setting a simple direction as possible. And getting started. Wherever you are. In this I also an attempt to document some of my practices around writing tests for Django projects. Terminology As in this Python testing style guide I followed in the past: I do not make a distinction between unit tests and integration tests. I generally refer to these types of tests as unit tests. I do not go out of my way to isolate a single unit of code and test it without consideration of the rest of the project. I do try to isolate a single unit of behaviour. Where do I place tests? The greatest … -
Django News - DjangoCon Europe 2021 Videos are live - Aug 20th 2021
News Django Survey 2021 Please take a moment to fill out the official Django Developers Survey. It helps the community know how Django and related tools/technologies are being used and guides the future development of the framework. jetbrains.com Wagtail 2.14.1 release notes Wagtail 2.14.1 is a bugfix release that fixes a Twitter embed bug and an Uncaught ReferenceError. wagtail.io Events Django Day Copenhagen 2021 The program will be announced on September 1st. djangoday.dk Sponsored Link REVSYS We’re senior Django developers, ops people, and consultants who have a deep and wide experience to pull from. We know what works and what doesn’t. We have been where you are before (probably many times). Let us guide you onto a better path. revsys.com Articles SQL Server 3rd Party Backend for Django v1.0 Released Official blog post on mssql-django, which is a Microsoft-backed 3rd party backend for Django. microsoft.com A Django admin list filter for PostgreSQL ArrayFields A quick and easy way to add an admin list filter to an ArrayField. medium.com Celery in production: Three more years of fixing bugs A detailed and very interesting look at issues faced by the Celery team. medium.com How to Use Celery for Scheduling Tasks Some practical … -
The Thirty Minute Rule
When it comes to coding (or anything related to it) there's a rule I believe in with all my heart. It's the Thirty Minute Rule. The rule is that if anyone gets stuck on something for more than 30 minutes, they should ask for help. By asking for help after 30 minutes it addresses the following things: Often we are stuck because of something we don’t know, making it impossible to proceed regardless of skill or intelligence. Makes it so we don’t get frustrated by being stuck on a problem for too long. Sometimes simply formulating the question to ask allows us to answer the problem ourselves. From a business standpoint, reduces costs because instead of hours or days or weeks being stuck, we move on after 30 minutes. FAQ Who do I ask for help? Whoever you can. Co-workers and collaborators are common. If they don't have the answer, online discussion forums, groups, or general social media are useful. This was the original use case for Stack Overflow. What if no one can give me an answer? Then you've got a real challenge. Solving hard problems is part of our job. Shouldn't people people figure stuff out on their … -
Speeding Up Python with Concurrency, Parallelism, and asyncio
Details what concurrency and parallel programming are in Python and shows practical examples of using multithreading, concurrent.futures, and asyncio. -
Django News - Design, DRF Recipes, Async, and more. - Aug 13th 2021
News Django Survey 2021 Please take a moment to fill out the official Django Developers Survey. It helps the community know how Django and related tools/technologies are being used and guide the future development of the framework. jetbrains.com PEP 665: Specifying Installation Requirements for Python Projects This PEP specifies a file format to list the Python package installation requirements, including lock files. github.io Sponsored Link REVSYS We’re senior Django developers, ops people, and consultants who have a deep and wide experience to pull from. We know what works and what doesn’t. We have been where you are before (probably many times). Let us guide you onto a better path. revsys.com Articles Django Rest Framework Recipes Are you looking for an extensive guide of Django Rest Framework recipes? Then look no more. tinystruggles.com async test patterns for Pytest Learn some handy async examples and patterns for testing in Pytest. github.io Building a Django driver for Psycopg 3 psycopg3 is the new implementation of the most popular PostgreSQL adapter for Python. psycopg.org Why You Should Use EditorConfig to Standardize Code Styles EditorConfig may be the standard you needed but didn't know it. freecodecamp.org Design Articles Adding Tailwind CSS to a Django Website … -
How to create a self-signed SSL certificate without much effort and run a local Django development server over HTTPS
Generating a self-signed SSL certificate for local Django development has always been a hassle for me. Until the day I discovered mkcert, a zero-config tool that creates locally trusted development certificates, your browser will not complain about. In this tutorial, I'll share my process, and you'll learn how to … Read now -
How to Use Celery for Scheduling Tasks
There are multiple ways to schedule tasks in your Django app, but there are some advantages to using Celery. It’s supported, scales well, and works nicely with Django. Given its wide use, there are also lots of resources for learning more about it, and once learned, that knowledge is likely to be useful on other projects. By the way, this blog is an updated version of one I wrote in 2014 on the same topic, but it applied to Celery 3.0.x. Celery Version 5.0.x This documentation applies to Celery 5.0.x. Earlier or later versions of Celery might behave differently. Also, links to Celery documentation might stop working if newer versions of Celery reorganize the documentation, which does happen. Introduction to Celery The purpose of Celery is to allow you to run code according to a schedule. Why might this be useful? Here are a couple of common cases: Case 1: Suppose a web request has come in from a user, who is waiting for the request to complete so a new page can load in their browser. Based on their request, you have some code to run that's going to take a while (longer than the person might want to … -
What is GraphQL and how to use GraphQL in Django? #01
What is GraphQL? A query language for your API Before we start, let's get to know what is GraphQL? If we refer to its docs, GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a co... -
How to create a self-signed SSL certificate without much effort and run a local Django development server over HTTPS
Generating a self-signed SSL certificate for local Django development has always been a hassle for me. Until the day I discovered mkcert, a zero-config tool that creates locally trusted development certificates, your browser will not complain about. In this tutorial, I'll share my process, and you'll learn how to … Read now -
Creating and Understanding a Django project
Overview Okay peeps, welcome back, it's been a while now, so let's get to it. I'll be talking to you about creating a django project and explaining the project structure and some files inside the project. For the purpose of this series, we'll be crea... -
How to safely move a model to another app in Django
Intro In most cases, we start building our Django projects with a small number of Django apps. At some point, our projects grow and apps become larger which complicates the code maintenance. And we start thinking about refactoring - splitting a big... -
Django QuerySet Examples (with SQL code included)
Intro In this article, you will find the most commonly used Django QuerySet examples with SQL codes. A QuerySet describes a collection of objects/rows from your database. At some point, QuerySets are being "converted" to SQL queries. And one of t... -
Django QuerySet Examples (with SQL code included)
Intro In this article, you will find the most commonly used Django QuerySet examples with SQL codes. A QuerySet describes a collection of objects/rows from your database. At some point, QuerySets are being "converted" to SQL queries. And one of t... -
How to use Django shell in Jupyter Notebook
Intro Running Django, especially Django querysets in Jupiter notebooks might be useful if you want to analyze/plot the data that is in your database. Also, sometimes it's hard to execute big querysets in CLI using Django's interactive shell. In this... -
How to use Django shell in Jupyter Notebook
Intro Running Django, especially Django querysets in Jupiter notebooks might be useful if you want to analyze/plot the data that is in your database. Also, sometimes it's hard to execute big querysets in CLI using Django's interactive shell. In this... -
Django Login Redirect
I have decided to dump the Django login view and make my own, but I am now faced with the issue of Redirecting the user to the homepage when login successfully seems easy 😋 Redirecting user to previously requested page upon being redirect to login ... -
Let's add QR feature for our Django application!
The mobile phone has become a must in our day-to-day life and is quite useful as it is the simplest means for communication, sharing, and creation of data. One simple way of sharing data is by using QR. We often do see in restaurants, on the dining t... -
About Finite-State Machines in Django
Finite-state machines (FSMs) are awesome. I was first introduced to the concept through the XState JS package. This package is, obviously, geared towards front end work, but the concepts are the same. Now, I'm no expert in the theory behind FSMs, so ... -
Django News - Annual Django Survey and Django 3.2.6 Bugfix Release - Aug 6th 2021
News Django Developers Survey 2021 by JetBrains and the DSF Please take a moment to fill out the official Django Developers Survey. It helps the community know how Django and related tools/technologies are being used and guide the future development of the framework. jetbrains.com Django bugfix release: 3.2.6 New Django bugfix available. As always, the best security is to be up-to-date with the latest version of Django. Here are the official docs on how to upgrade properly. djangoproject.com Events Call for Proposals | Django Day Copenhagen 2020 The third Django Day will take place on September 24th, 2021. Deadline for submissions is August 15th. djangoday.dk Sponsored Link REVSYS We’re senior Django developers, ops people, and consultants who have a deep and wide experience to pull from. We know what works and what doesn’t. We have been where you are before (probably many times). Let us guide you onto a better path. revsys.com Articles Get yourself a better Django proxy experience by Niccolò Mineo A couple of tips when working with Django proxies that will make end-users grateful and developers sigh in relief. medium.com Django Todo App with AJAX and jQuery Detailed look at an async Django todo app powered by … -
About Postponed Evaluation of Annotations
Let's say you're working on a Django project, and you have a model with a custom create method on the manager: # managers.py class MyManager: def create(self): # your custom logic here return super().create() # models.py from .ma... -
Contributing to Django - David Smith
David Smith on Twitterdjango-crispy-formsdjangobenchDiátaxis FrameworkAirspeed Velocity (ASV)DSF Triage & Review TeamVictor Stinner’s Notes on Benchmarking PythonSupport the ShowThis podcast does not have any ads or sponsors. To support the show, please consider visiting LearnDjango.com, Button, or Django News. -
About self.subTest
self.subTest is a part of Django's TestCase class and is used as follows: def test_a_view(self): response = self.client.get(url) with self.subTest("Response status code"): self.assertEqual(response.status_code, 200) with self.su... -
Django Login and Logout Users
Hello and welcome to the second part of this series, I hope you have implemented the user's registration with email confirmation discussed in part one, today we will implement the following Authentication Vs Authorization User Login and Logout P...