Here are a few Django packages that I have found useful multiple times when setting up a new Django application. Feel free to reach out if you have any questions about any of those listed here or if you have any suggestions of some that you think should be represented here.
Django Debug Toolbar is almost certainly a must-have for any project of even minor scale. It is a useful too for debugging issues you might have in an application. But mostly I use it for optimizing the Django ORM. Anybody who has used Django will know that when you start listing a bunch of objects and then reference related objects from those objects you can end up in a situation where you have exponential growth in the number of queries being performed (unless you properly select and prefetch the related objects). The toolbar has a component that tracks the number of queries being made, how long they take and how many times similar queries are run so that you can figure out where you need to select or prefetch the related objects. I have seen calls that go from making 10s of thousands of queries and taking 30+ seconds to making under 30 queries and taking under 100 milliseconds. That is what the toolbar can help you accomplish.
If you are choosing to use Django, in all likelihood you are going to have some concept of a "user" and will want the ability to communicate with the "user" using email.If not, I would suggest looking into other Python web frameworks. Not that you can't use Django in that case, but there are a lot of other frameworks out there that don't make such strong assumptions as Django. In any case, if you are using emails for communication,
django-anymail makes it very easy to integrate 3rd party email services.
When you ultimately want to deploy your Django application, you're going to need to decide how you're going to serve your static files. I have been using AWS for hosting for most of my career (for better or worse) and there is no doubting that it is easy and convenient. A very simple way to deal with hosting and serving your static files is to just throw them into an S3 bucket. You can then choose to use a CDN like CloudFront very easily.
django-s3-storage makes it very easy to configure and deploy your static files using the
collectstatic management command that Django provides.
A model field to store phone numbers for Django ORM.
django-phonenumber-field recognizes standard inputs and normalizes how you store the phone numbers to help avoid duplication and store numbers in a standardized format.It handles all the logic and is incredibly simple to use. It uses the very useful python-phonenumbers module.
Often, when using the Django ORM, we want to know the changing state of our objects. Django uses signals to give us hooks into when objects are changing, but it doesn't tell us how they are changing. You then have 2 options...implement tracking to know the state before / after a change or query the db at the time of saving to know the original values vs. the current values.
django-dirtyfields does the tracking for you to avoid the extra querying that would be required without you needing to write your own tracking code. There are a few other options out there, but some of the others I have tried seem to cause a lot of extra queries under certain scenarios, which somewhat defeats the purpose.
If you are planning to have an API for your application (or if, indeed, all your application is, is an API), then the Django Rest Framework is definitely worth a look. It's probably the most widely used and robustly tested. I have had a love/hate relationship with DRF over the years, but ultimately you can't argue with the ability to spin up a bunch of endpoints extremely quickly. They also do a pretty good job of making it customizable in different ways and ultimately you can get started quickly and then accomplish whatever it is you want to do with it. Like Django, the defaults are pretty opinionated, but in general I don't mind the assumptions made and as I have already indicated, it's not too difficult to customize. The documentation is pretty good, but ultimately if you really want to get stuff done, you are likely going to need to hop into the code of the framework to understand how to make your customizations. Ideally one of the big adds of a framework like this is the automatic generation of documentation. In principle, this is great, but I have to say that current offerings for DRF leave a lot to be desired. Especially when you start to do more and more complex customizations.
If you have an API and your front-end application is on a different domain or sub-domain than your API, you will need to support CORS.
django-cors-headers makes this super simple to support.
I don't typically like sharing my primary keys with the outside world through my API. It can be done in a way that doesn't pose security risks, but you have to be more attentive with how you structure your API and be careful about what information this gives somebody who might be malicious. I won't go into the concerns here, but in general, I prefer to generate globally unique identifiers for objects that need to be surfaced in the API. Python has the
uuid module that allows you to generate large unique IDs, but they are encoded in a way that the character representation is quite long and unwieldy (not to mention how they look in URLs).
shortuuid takes the
uuid and encodes it into 22 characters for a smaller, more URL-friendly identifier. There are alternatives that can actually encode information in the generated identifier (like object type), but I have been using
shortuuid the longest and it has served my purposes well.
If you're not familiar, sentry is a tool for monitoring your application, with an emphasis on error reporting. What I love about sentry.io specifically, is that they have a great free offering, super simple to setup and for me is a no-brainer in pretty much any application I would build. When I have used them for professional work, I usually end up purchasing the first tier which is under $30 / month and I've never really had to go over that. It's a great tool with an easy to use dashboard and has all sorts of integrations for alerting you when errors occur. For most Django projects it takes about 5 minutes to setup and then you instantly have insights into the errors occurring in your remote environments.