Published: May 26, 2019
Deploying Django has often been a confusing and hard topic for many who are starting out in Django development.
It takes time in playing around with various deployment options to actually get to the right technology or practices in deploying Django projects.
I will be covering the various ways to deploy your Django web application, I hope it might be useful for anyone who is starting out.
Literally, it comes down to three questions you should ask yourself whenever you are looking to deploy a Django project.
Do note that for the sake of convenience and you are the only person. Who is responsible for deploying your Django project.
Do note that if you plan to drive down the cost to deploy significantly, you need to understand the various technologies associated with making the process easier.
This does include the cost for maintenance of the deployment process and monitoring the health of your server.
To prevent it from crashing if your server has been overloaded through multiple requests or DDoS attacks.
You need to estimate what is the number of monthly users for your architecture when you are planning to deploy for your Django application.
There is a massive difference between scaling for ten thousands or hundred thousands of monthly users vs scaling it for one million monthly users.
Which uses many tools & practices, this even takes from the playbook of IT service management to maintain the availability and performance of your Django project.
Which I'm pretty sure is not taught often as part of software development.
To have a glimpse of how to scale Django, I would suggest looking at the book called High-Performance Django.
That I had used it as part of a reference guide when I was starting out to learn to develop in Django.
It could take weeks or months of your time to refine and running smoothly. If you are interested in the experience in deploying Django in the production environment.
I came across Randall Degges in his article Deploying Django to deploy for a startup I am currently in.
Which was way before we pick up CI/CD practices and the use of Docker containers to make deployment and development much easier for us.
I hope that this article is helpful for anyone who is developing in Django and looking towards the deployment.
If you are just the only person, who is deploying the Django project you can take a look at using cloud providers or use Zappa that taps on the AWS Lambda and API Gateway for deploying your Django project using AWS.
Lastly, Before deploying your Django web application or REST API endpoints to your production environment look at Deployment Checklist and Security In Django before deploying to prevent security breaches.