Django Boilerplate

screenshot of Django Boilerplate

A Django boilerplate project with docker, celery, nginx setup alongside prometheus & grafana monitoring

Overview

Setting up a robust web application using Django can be a complex task, but with the right instructions, it becomes much more manageable. This guide essentially walks you through configuring your Django project for both development and production environments, ensuring you understand the nuances of each setup. Whether you're testing locally with the default development server or deploying a production-ready application with Gunicorn and Nginx, there are clear steps to follow.

In the development phase, you’ll benefit from rapid testing and real-time code changes thanks to the mounted app folder, while the production setup emphasizes stability and security with a focus on properly configured environment variables and no mounted folders. This approach ensures your application performs optimally, whether in a testing phase or upon full deployment.

Features

  • Default Django Development Server: Quickly set up your development environment using Django's built-in server for efficient local testing.
  • Easy Environment Configuration: Simply rename sample environment files (.env.dev-sample) and update variables as needed to suit your project.
  • Real-time Code Changes: With the "app" folder mounted into the container, any code changes you make are automatically reflected without needing to restart the server.
  • Production-ready Setup: Utilize Gunicorn and Nginx for a powerful and efficient web server solution that handles high traffic loads effectively.
  • Static Environment Variables: In production, establish fixed environment settings so that you don’t have to worry about potential vulnerabilities from mounted folders.
  • Image Management: Build your Docker images easily for both development and production, providing simple commands to keep your containers running smoothly.
  • Local Testing URLs: Access your apps swiftly at designated local URLs (http://localhost:8000 for development and http://localhost:1337 for production) to streamline your workflow.