Top 5 3rd party packages

Hi all,

I’m curious anecdotally what are must-haves? There are so many wonderful ones out there but I’m often asked by newcomers which ones to use and don’t want to overwhelm them.

My quick picks that are widely applicable:

  1. djangorestframework
  2. django-debug-toolbar
  3. django-extensions
  4. django-cors-headers
  5. django-allauth

And to cheat here are 5 more:

  • django-environ
  • whitenoise
  • django-crispy-forms
  • django-filter
  • dj-database-url
11 Likes

I use these “five” in just about every project I touch these days:

  • black
  • django-allauth
  • django-click
  • django-dbbackup
  • django-environ
  • django-lifecycle
  • django-test-plus
  • djangorestframework
  • pytest + pytest-django
  • python-frontmatter
  • python-slugify
  • whitenoise

Updated to add:

  • model-bakery
5 Likes

For python-frontmatter, what’s an example of when you add YAML to a Django project?

Also I agree there a bunch of Python-specific packages needed in most Django projects and I’ve added a “Python Packages” section to awesome-django repo to reflect this just now.

My needs are more “limited” in nature than most - but my most important are:
django-extensions
django-debug-toolbar / django-debug-toolbar-request-history
djangorestframework
django-crispy-forms
django-environ

To cheat some more:
django-datatables-view
django-treebeard
django-braces

2 Likes

For python-frontmatter, what’s an example of when you add YAML to a Django project?

I use it for importing and sometimes exporting data that I also want to be version controlled. I wrote a library to help with it, but I never got around to releasing it.

I love the flexibility of having a database, but the searchability kind-of sucks when you need to find/update one piece of data that may be stored in four to six different tables or in a template. It’s really hard to beat git grep plus having db data stored as frontmatter makes having pages staged over multiple environments way easier than trying to draft changes from staging and copying over to production.

Any good packages for handling model instance versioning?

I know there are a few options (like django-reversion) but haven’t had time to try any of them yet.

My “must-have” packages in almost every new Django project:

  1. django-configurations
  2. django-extensions
  3. django-environ
  4. pytest (with pytest-django)
  5. model_bakery (ex model_mommy)
1 Like

I have gotten some decent mileage out of django-simple-history for something quick and effective.

On a recent project, I wanted to be able to able to store pending model changes that needed to be reviewed and nothing off the shelf really worked that I could fine. Using Django’s contrib Postgres JSONField plus DRF’s ModelSerializer and I had something working within half an hour that I could live with. That said, I would not recommend going this route, but it’s more easily solved today than it was three or four years ago.

1 Like

Thanks, I actually hacked together pretty much the same solution. A “snapshot” table for each model with JSONField that’s populated using a DRF Model serializer, with a creation and deletion timestamp.

We also need to handle the edit suggestions and have “XXXSuggestion” models that we use to let users suggest changes that also use a JSON field for a suggested snapshot.

django-simple-history looks like a great alternative

I really enjoyed using django-lifecycle to glue my project together. I also used a http://jsonpatch.com/ library to make the JSON Diff view much easier to grok from diff to diff.

1 Like

https://github.com/groveco/django-sql-explorer Django Explorer. Provide new reports without a new build.

(oh, and django-debug-toolbar & django-extensions)

1 Like

So many great lists already! I’d like to add 5 more “speciality” packages–not must haves–that haven’t been on any other list:

  • django-channels: if you need websockets
  • django-csp: for helping lock-down your application from client-side attacks
  • django-herald: if you want to make sending emails or any messages just easier
  • django-taggit: fantastic general purpose tagging library
  • sorl-thumbnail: great image library for resizing or a bunch of different things
2 Likes

Wow! That looks awesome! I’m going to have to try it out sometime.

1 Like

I thought making this list was going to be easy, but in fact most of the one that comes in my head are general Python packages… I would say:

  • djangorestframework
  • django-impersonate
  • django-debug-toolbar
  • django_coverage_plugin (just to quote coverage in general)
  • factory_boy (to ease tests with a lot of models)
1 Like

Hello at axiacore.com we using this packages:

  • channels_redis

  • channels

  • coverag

  • gunicorn

  • huey

  • ipython

  • Pillow

  • piprot

  • prospector

  • psycopg2-binary

  • pytest-cov

  • pytest-mock

  • pytest

  • python_magic

  • raven

  • requests

  • uvicorn

  • django-admin-sortable

  • django-axes

  • django-compressor

  • django-debug-toolbar

  • django-extensions

  • django-redis

  • django-widget-tweaks

  • pytest-django

1 Like

My top 5 packages for every project i start would be.

  • django-environ
  • django-cors-headers
  • djangorestframework
  • djangorestframework_simplejwt
  • django-webpack-loader

Other 5 packages I frequently use:

  • django-filter
  • django-taggit
  • django-debug-toolbar
  • django-silk
  • django-extensions
1 Like

Base 7 packages I use in every Django-based projects:

django-configurations
django-debug-toolbar
dj-database-url
dj-email-url
pip-tools
psycopg2
python-dotenv

Other 7 packages I use often:

djangorestframework (with other plugins)
django-extensions
django-hashid-field
django-localflavor
django-money
django-phonenumber-field
django-postgres-copy

Finally 7 python packages I use to check and test the project:

black
coverage
flake8 (with other flake8-* plugin)
isort
mypy
pre-commit
tox
1 Like

These are some great packages listed so far from everyone! I’ve definitely checked on a bunch that I’ve never seen before. Here’s my top 5 (plus the why):

  • celery (for background tasks)
  • djangorestframework (for APIs)
  • django-cors-headers (for CORS, ugh)
  • django-storages (for media uploads)
  • django-waffle (for feature flagging)
3 Likes

My main work is building and maintaining a Django REST API, but I have also built GraphQL servers in Django.

  1. djangorestframework
  2. django-rest-knox - Token authentication for django-rest-framework
  3. sentry-sdk - For error reports
  4. Graphene - For building GraphQL servers
  5. django-filter

++ Bonus:

  • django-pytest - Because pytest is the best testing library for Python
  • factory-boy - Building model factories for testing.
1 Like
  1. Djangorestframework
  2. django-auth-adfs (also works with Azure AD)
  3. django-guid (Injects a GUID to every log message connected to a request. Disclaimer: my own package)
  4. drf-yasg for swagger documentation
  5. djangorestframework-camel-case for camelCasing snake_case stuff in DRF

( New user, so can only put two links in my post…)

1 Like