Hi reader,
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.
You can buy it here: https://raturinitin.gumroad.com/l/django-dockerized-starter-boilerplate
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
.env
file by copying.env.sample
with the command:cp .env.sample .env
.Establish the necessary directories, namely templates and static, at the base level where
manage.py
resides.Launch the containers using
./run.sh
.To stop the containers, use
./stop.sh
.
For Production:
Create a
.env.prod
file 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_HOST
variable within the.env.prod
file.Execute
./run-prod.sh
to 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
.env
file using.env.sample
As a template:cp .env.sample .env
.Inside the
.env
file setDEBUG
to True andSQL_ENGINE
to django.db.backends.sqlite3.Create the required directories, templates, and static, at the base level where
manage.py
is 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.
If you get stuck while deploying or running this boilerplate, reach out to me at Twitter @raturinitin
You can buy it here: https://raturinitin.gumroad.com/l/django-dockerized-starter-boilerplate