Production Ready Dockerized Django Application
Presenting to you a turnkey solution that allows you to effortlessly launch your Django server with a single script. Whether you're in the early stages of development or preparing to go live in a production environment, my Dockerized Django application has you covered. Just unzip the repository, execute ./run.sh for development, or ./run-prod.sh for production on your server. With this boilerplate, you'll be hosting your Django application with HTTPS support and Django 4.2 LTS.
Features:
- Django-Starter-Boilerplate: A production-ready, SSL-enabled, and containerized Django boilerplate that streamlines your deployment process.
Dependencies:
- Docker: The industry-standard containerization platform.
- Docker Compose: A tool for defining and running multi-container Docker applications.
Getting Started with Docker:
- Unzip the repository.
- Create a
.envfile by copying.env.samplewith the command:cp .env.sample .env. - Establish the necessary directories, namely templates and static, at the base level where
manage.pyresides. - Launch the containers using
./run.sh. - To stop the containers, use
./stop.sh.
For Production:
- Create a
.env.prodfile and populate it by copying and replacing values from.env.sample. - Configure your DNS 'A' records to point to the value specified in the
VIRTUAL_HOSTvariable within the.env.prodfile. - Execute
./run-prod.shto initiate the production-ready containers.
Note: In a development environment, ./stop.sh also removes the associated volumes, so use this command with caution.
Running Without Docker:
- Unzip the repository.
- Create a
.envfile using.env.sampleas a template:cp .env.sample .env. - Inside the
.envfile, setDEBUGto True andSQL_ENGINEto django.db.backends.sqlite3. - Create the required directories, templates and static, at the base level where
manage.pyis located. - Initiate your Django server with the command:
python manage.py runserver.
That's it! With this production-ready Dockerized Django application, you can expedite your Django project deployment, confident in its performance, security, and ease of use. Say goodbye to the complexities of setup and hello to efficient Django application hosting.
You'll get a zip file having dockerized django starter boilerplate