Are you starting a Django project soon? You’re probably wondering whether there are any useful packages out there that could help you out. Here’s a list of the most valuable Django packages with a short link and descriptions to help you get them quickly to work without doing lots of research. All the packages I chose support Python 3 and are in a stable version.

Are you starting a Django project soon? You’re probably wondering whether there are any useful packages out there that could help you out in your projects.

Here’s a list of the most valuable Django packages with links and descriptions to help you get them quickly to work without having to do a lot of research beforehand. All the packages I chose support Python 3 and are in a stable version to help support a wide range of Django projects.

Ready to explore the world of Django packages? Let’s dive in!


But first – is Django a library?

It’s easy to get lost in the world of Python tools because there are so many new frameworks and libraries available in its ecosystem today.

Still, it’s worth to clarify this: Django is not a library, but a framework.

Django is a free, open-source, high-level Python web framework that promotes rapid development and clean design. It was developed by a group of experienced programmers who aimed to remove the hassle of developing web apps and allow teams to focus on writing code without having to reinvent the wheel every time. That means writing fewer lines of code!

Thanks to its incredible speed, high security, flexibility, and scalability, Django quickly gained traction and today is one of the most popular technologies for web development projects in Python.

For those taking their first steps in Django, we recommend this article: What is Django and how to get started?


Modules vs. packages – what are modules in Django?

Modules and packages are sometimes confused with one another, so let’s take a moment to explain the difference before we move on to our list.

A package refers to a collection of Python modules. A module is a single Python file, while a package is a directory of such modules. A package contains an additional __init__.py file to distinguish itself from a mere directory that includes some Python scripts.

In this article, you will find 30 Python built-in modules you should be using in your project. Check if you know them all!

The best Django packages

Note: Since there are several good reasons why coding frontend in Django isn’t the best idea, I decided to focus on packages for backend projects.


Structure of the article:

{priority}. {name}

Doc: {doc_url}

Desc: {desc}

Solves: {main_issue_solved_by_package}

Awesomeness: {cool_point for cool_point in coolness_points}

1. sentry-sdk

Documentation:

https://docs.sentry.io/platforms/python/django/

Description:

  • This is a must-have tool for any Django project as it’s key that we stay informed about all the code-based issues in the application.
  • Firstly: the package immediately alerts us about all the previously-uncaught exceptions that occurred in production.
  • Secondly: we can catch the issue ourselves and send the error information to sentry, adding even more relevant data.
  • Building an alert system on our own is definitely non-trivial and debugging without this kind of logs is next to impossible.

Solves:

That situation when the server throws an error and you don’t have to investigate it.

Awesomeness:

  • It will catch any uncaught exceptions (which means 500 returned from the server with no further information usually) and send us full details about the issue right after it happens.
  • When the code is working correctly, the sentry is useful as an alert system to which we can send the errors or logs about any non-normal events.


2. djangorestframework

Documentation:

https://www.django-rest-framework.org

Description:

If you want to write a REST Architectural Constraints API, this package will do that for you – together with proper, auto-generated documentation that supports implementing the package in projects.

Solves:

No need to write the REST API yourself.

Awesomeness:

  • Creating REST API endpoints for your models will take just a few lines of code.
  • Auto-generated documentation is great because it always changes with the endpoints.

You may be interested in this: The Ultimate Django Rest Framework Tutorial


3. django-extensions

Documentation:

https://django-extensions.readthedocs.io/en/stable/index.html

Description:

  • A set of tools that help with your daily work.
  • JSONField was at first introduced in this package before it officially became part of Django 1.9 (for PostgreSQL, of course).
  • V See the awesomeness list below V But keep in mind that this repo solves several other problems, I just found them rather boring and uncommon.

Solves:

Adds a bunch of random useful functionalities.

Awesomeness:

  • command shell_plus runs Django shell with preloaded files, classes, and models that speed up any work with the Django shell.
  • More fields that include:
    • AutoSlugField – generates a unique slug for given data
    • CreationDateTimeField and ModificationDateTimeField – stores the first save to the database and the last DateTime modification.
    • Job scheduling with Django! You’ll still need some cron, but having scripts in Django makes it easier to administrate.

You might like this: 6 expert tips for building better Django models


4. django-rest-framework-jwt

Documentation:

http://getblimp.github.io/django-rest-framework-jwt/

Description:

While using DRF for some projects, it’s essential to add some JWT token authorization. That’s exactly what this package is about.

Solves:

You won’t have to implement and manage the Authentication token for the API on your own.

Awesomeness:

Provides everything you need for JWT Auth: the login endpoint and Django auth class.


5. django-rest-swagger

Documentation:

https://marcgibbons.com/django-rest-swagger/

Description:

The DRF offers auto-generated documentation – and this package makes the documentation nicer for your projects.

Solves:

Creates nice documentation out of the DRF API for free.

Awesomeness:

  • Nice auto-documentation for your endpoints.
  • It’s easy to document custom endpoints manually.


6. easy-thumbnails

Documentation:

https://easy-thumbnails.readthedocs.io/en/stable/

Description:

Any web service that allows uploading and viewing photos needs the thumbnails feature. This package provides it.

Solves:

All servers hosting images need thumbnails, and this package is the solution.

Awesomeness:

Configurable thumbnails filed for Django models that automatically generates a smaller version of the uploaded image.


7. django-simple-history

Documentation:

https://django-simple-history.readthedocs.io/

Description:

This package keeps a history of record changes. If a client has access to the database through the admin panel, they might change something by mistake or may want to return to the previous version of the text.

Solves:

Keeps a history of changed rows in the database.

Awesomeness:

Keeps track of all model changes while setup takes no time.


8. django-adminactions

Documentation:

https://django-adminactions.readthedocs.io

Description:

A simple data export to known file types like CSV or XLS. You can also export data as a fixture to the test server, and this fixture can contain Foreign Keys. The package allows generating graphs in the admin panel as well.

Solves:

Adds some functions that come in handy during the early stages of developing an app.

Awesomeness:

Export data from admin panel to XSL, CSV, Fixture.


9. django-model-utils

Documentation:

https://django-model-utils.readthedocs.io/en/latest/index.html

Description:

A set of useful utils for Django models.

Solves:

Adds some models and fields that already help with some common issues.

Awesomeness:

MonitorField field that is DateTime field and its update to now() each time the field it’s looking to get updated.


10. django-storages

Documentation:

https://django-storages.readthedocs.io/en/latest/

Description:

  • Allows using any cloud storage services as the default file storage. That becomes important when you want to pass whatever users send us to another storage.
  • For example, a user may send us a lot of substantial data like photos, movies, or even backups. To make this data available for them without slowing down the app, it’s a good idea to use cloud storage solutions like Google Cloud.

Solves:

Using almost any remote storage as the Django default file storage.

Awesomeness:

Allows using s3 or Google storage as default file storage.


Extra: What is Django Allauth?

The list above includes the very best Django packages available in its rich ecosystem. But there’s one more package that I though should become part of this list as an extra.


django-allauth

Doc: https://django-allauth.readthedocs.io/en/latest/

This package offers an integrated set of Django applications that address problems like authentication, registration, account management, as well as third-party account authentication (think social media accounts).

Why I included it here:

The majority of existing Django apps which tackle the problem of social authentication focus only on that functionality. To support authentication via a local account, developers usually need to integrate another app. By following this approach, local and social authentications become separated and integrating them is challenging.

django-allauth was created to fill this gap, offering users a tool designed to include a fully-integrate authentication app that allows both local and social authentication.


The takeaway

Python has become an essential programming language for web development projects for many reasons. One of them is the rich ecosystem of libraries, frameworks, and tools like packages that help software developers accelerate the process of building apps, manage it better, and focus on what matters most (like app architecture or translating business logic).

I hope this list of Django packages helps you next time you develop a web app using Python and Django. If you want to learn more about Django packages, have a look at this helpful site: https://djangopackages.org/.

Also, don’t forget to browse our company blog for more handy tips about building Django apps!


Andrzej Dabski
Andrzej

Andrzej is a Python developer who has been involved in many different projects, from the healthcare industry to lending cryptocurrency project. He likes to work on projects that allow him to learn new things. Andrzej is currently studying Computer Science and likes to catch up with all the latest technologies. He likes good puzzles and bad jokes.

Python

When to use Django? 3 examples and benefits for different industries

Django is one of the most popular frameworks for web application development today. This handy open-source framework allows for rapid development, offers support from a large and active community [...]

Python

The Ultimate Tutorial for Django REST Framework: Selective Fields and Related Objects (Part 7)

This is the last part of my tutorial for the Django REST framework. Be sure to catch up with the work we’ve completed in other parts of the series: [...]

Join our newsletter.

Scroll to bottom

Hi there, we use cookies to provide you with an amazing experience on our site. If you continue without changing the settings, we'll assume that you're happy to receive all cookies on the Sunscrapers website. You can change your cookie settings at any time.

Learn more