Don't Forget To Use These 6 Effective Django Utilities In Your Next Python Project
Make your Python-Django work environment much more efficient with these tools

Codecast is a reader supported publication. If you are reading this and haven’t subscribed yet, know that you’ll never be able to read these kind of quality programming articles again if you don’t.
Time is running out. Subscribe (for free) to not miss any future posts 👇
Django is admittedly one of the most popular full-stack frameworks in use. It has a great community of creators, developers, maintainers, and users ranging from indie hackers to large companies.
In this article, I want to mention a few open source tools, resources, and libraries that I regularly employ to make my Django project development better.
Let's get started!
1. django-authuser
How many times have you begun a new Django project and wasted previous time in defining the user authenticationmodels? I used to.
django-authuser is an open source repository provides a reusable custom user model for Django projects so you don’t have to write your own.
Here is how I include it quickly in my project without even leaving the command line:
Download the zip package of the GitHub project
Unzip the package
Rename the package to “auth” included as an app in the project
Remove the zip file
Steal these commands for later use in your own projects:
curl -L -o django-authuser.zip https://github.com/sesh/django-authuser/archive/refs/heads/main.zip
unzip django-authuser.zip
mv django-authuser-main auth
rm -r django-authuser.zip
2. gibo
This is another library to save you precious time: this time from writing .gitignore
files by yourself.
gibo helps you access all the .gitignore boilerplates from github.com/github/gitignore directly from the command line.
Be it a framework or a programming language, gibo can make sure you have your .gitignore
file setup in seconds rather than minutes.
Install it easily with Homebrew on Mac and Linux and Git or scoop on Windows.
Here’s how I use it in my Django / Python projects:
gibo dump Python macOS VisualStudioCode VirtualEnv >>.gitignore
3. djhtml
DjHTML is a fully automatic template indenter that works with mixed HTML/CSS/Javascript templates that contain Django template tags. It works similar to other code-formatting tools such as Black and also interoperates nicely with pre-commit.
— from the docs
Install it:
pip install djhtml
Instantiate it with the pre-commit
tool:
$ pip install pre-commit
$ pre-commit install
Your pre-commit-config.yaml
should look something like this (if you’re using Black too, which you should) :
repos:
- repo: https://github.com/rtts/djhtml
rev: v1.5.2
hooks:
- id: djhtml
files: .*/templates/.*\.html$
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
For a more in-depth guide to pre-commit tools, read my Python code-formatting article from here:
4. django-browser-reload
Do you feel absolutely lazy about reloading the browser every time you make changes in your Django app? I did too. Then I discovered this library.
django-browser-reload, as the name implies, is an open-source tool to auto reload your browser by automatically detecting changes in your application.
It’s a development dependency too, so it only works when DEBUG = True
in your settings.py
.
Install and use it:
pip install django-browser-reload
Add it to your installed apps:
INSTALLED_APPS = [
...,
"django_browser_reload",
...,
]
Include the app URL’s in your root URLconf(s):
from django.urls import include, path
urlpatterns = [
...,
path("__reload__/", include("django_browser_reload.urls")),
]
and finally, add the middleware:
MIDDLEWARE = [
# ...
"django_browser_reload.middleware.BrowserReloadMiddleware",
# ...
]
5. django-tailwind
django-tailwind provides an efficient way to utilize the CSS utility framework tailwind with your Django project, without the headache of NPM.
Install it:
pip install django-tailwind
Add it to your setting.py
:
INSTALLED_APPS = [
...
"tailwind",
]
Run this command to automatically create a Django app called theme in their root directory:
python manage.py tailwind init
Add it to your settings.py
:
TAILWIND_APP_NAME = "theme"
INTERNAL_IPS = [
"127.0.0.1",
]
Then finally install the theme using to get started:
python manage.py tailwind install
6. crispy-tailwind
Similar to django-crispy-forms, crispy-tailwind helps you automatically create styled tailwind form components in your Django apps.
Install it:
pip install crispy-tailwind
Add the following to your settings.py
:
INSTALLED_APPS = [
...
"crispy_forms",
"crispy_tailwind",
]
CRISPY_ALLOWED_TEMPLATE_PACKS = "tailwind"
CRISPY_TEMPLATE_PACK = "tailwind"
A few parting words…
Thank you for reading this short guide on some very useful tools in Django that I’d discovered over the past few months. If you have any other suggestions, feel free to comment, I’d love to know anything that I’m missing out on! :)
Also find me on Twitter.
If you found value in this post, tell a friend about it: