Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django Best Practices: Function-Based Views vs Class-Based Views
Django's use of both function-based views (FBVs) and class-based views (CBVs) causes a lot of confusion for newcomers. Why have multiple ways to do the same thing? And which one … -
Django Best Practices: Referencing the User Model
Django has a powerful, built-in [user authentication system](https://docs.djangoproject.com/en/4.0/topics/auth/default/) that makes it quick and easy to add [login, logout, and signup functionality](https://learndjango.com/tutorials/django-login-and-logout-tutorial) to a website. But how should a Django developer … -
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. … -
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 … -
Django Hello, World 5 Different Ways
Django is a "batteries-included" framework that comes with built-in scaffolding provided by the `startproject` command and the general concepts of apps. But, actually, Django provides incredible flexibility if desired around … -
Django Hosting & Deployment Options
[Django](https://www.djangoproject.com/) websites can be deployed on any number of hosting providers. The first choice is deciding whether to use a Platform-as-a-service (PaaS) option or a virtual private server (VPS). A … -
How to Learn Django (2023)
__Note__: I gave a version of this tutorial at DjangoCon US 2022. You can see the video here: <iframe width="738" height="417" src="https://www.youtube.com/embed/rIt0uj8TaKg" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" … -
Official Django REST Framework Tutorial - A Beginners Guide
This is a beginner-friendly guide to the official Django Rest Framework [tutorial](http://www.django-rest-framework.org/tutorial/1-serialization/) that works for both Windows and macOS. If you have struggled to complete the official tutorial on your … -
Psycopg3 Binary and Django 4.2 Installation Quick Tip
One of [Django 4.2's major features](https://docs.djangoproject.com/en/4.2/releases/4.2/#psycopg-3-support) is support for [Psycopg 3](https://www.psycopg.org/psycopg3/), the new implementation of the popular PostgreSQL adapter for Python. It is a replacement for Psycopg 2 that adds … -
Top 10 Django Third-Party Packages
Django is a "batteries-included" web framework, but it really shines with its robust ecosystem of third-party packages that add additional functionality to the framework. There are almost 4,000 available at … -
Deploy Django + PostgreSQL on Fly.io
In this guide we will develop a Django Todo application locally and then deploy it on [Fly.io](https://fly.io) with a [Postgres production database](https://fly.io/docs/reference/postgres/). There are a number of steps needed to … -
Django Hello, World + Fly.io Deployment
In this tutorial, we will build a "Hello, World" website with Django and then deploy it to [Fly.io](https://fly.io/). If you want to learn Django properly, I provide step-by-step instructions and … -
Django RSS Feed Tutorial
Django comes with a built-in [syndication feed](https://docs.djangoproject.com/en/dev/ref/contrib/syndication/) for dynamically generating [RSS (Really Simple Syndication)](https://en.wikipedia.org/wiki/RSS) or [Atom](https://en.wikipedia.org/wiki/Atom_(web_standard)) feeds. These feeds contain recently updated content on a website, and users can subscribe … -
How to Install Django
This tutorial covers how to properly install the latest version of [Django (4.2)](https://www.djangoproject.com/) and [Python (3.11)](https://www.python.org). As the [official docs note](https://docs.djangoproject.com/en/dev/topics/install/), if you are already familiar with the command line, … -
Django File (and Image) Uploads Tutorial
This tutorial shows how to implement file and then image uploading with Django. We'll build a basic Instagram clone. ## Setup Whether you're on a Windows or Mac laptop the … -
Flask vs Django (2023)
[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 … -
Frequently Asked Questions about Django
## What is Django? Django is a Python web framework that takes care of the difficult and common parts of web development--authentication, database connection, CRUD (Create, Read, Update, Delete) operations, … -
Django ORM and QuerySets Tutorial
The Django [Object-Relational Mapper (ORM)](https://docs.djangoproject.com/en/dev/topics/db/) is one of the most powerful aspects of the web framework, an abstraction layer that allows developers to write object-oriented Python code which is translated … -
Django Sitemap Tutorial
Django has a built-in [sitemap framework](https://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/) that allows developers to generate sitemaps for a project dynamically. A sitemap is an XML file that informs search engines of your website's pages, … -
Django Log In with Email not Username
Django was first released in 2005 and since then a lot has changed in web development, notably the predominant pattern at the time of using username/email/password has been simplified to … -
pre-commit with Django
[pre-commit](https://pre-commit.com/) is a widely-used code quality framework. It allows a developer to add [hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) for various code quality tools that check your code for any errors or issues _before_ committing … -
Add robots.txt to a Django website
A "bot" is a general term for an automated program that does things like crawl the web. Google and other search engines rely on bots to periodically crawl the internet. … -
Django Static Files and Templates
Static files like CSS, JavaScript, and fonts are a core piece of any modern web application. They are also typically confusing for Django newcomers since Django provides tremendous flexibility around … -
Django Dependency Management with pip-compile and pip-tools
Even a basic Django project has multiple dependencies. After installing Django itself, various third-party packages--and their dependencies!--must be installed and managed. How do you track version numbers in a reproducible … -
Django Login and Logout Tutorial
In this tutorial, we'll learn how to configure login/logout functionality with Django's built-in [user authentication system](https://docs.djangoproject.com/en/4.2/topics/auth/). This post is the first in a three-part series that also covers [signup](https://learndjango.com/tutorials/django-signup-tutorial) and …