A robust and production-ready template to start Django projects with modern development best practices.
The django-wsgi-psql-tailwindcss-template is a complete starter template (boilerplate) for Django applications, integrating modern technologies and professional development tools:
- Django: Powerful and versatile Python web framework
- WSGI: Web Server Gateway Interface for production with Gunicorn
- PostgreSQL: Robust and scalable database
- Tailwind CSS: Utility-first CSS framework for responsive design
- Docker & Docker Compose: Containerization for development and production
- uv: Fast Python package manager
- Ruff: High-performance Python linter/formatter
-
Clone the repository:
$ git clone https://github.com/nando2003/django-wsgi-psql-tailwindcss-template.git
-
Install the dependencies:
$ uv sync $ npm install
-
Set up the environment variables:
$ cp .env.example .env # Edit the .env file to set your environment variables -
Generate a Django secret key and set it in the
.envfile:$ uv run python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())" -
Run the development container:
$ docker compose up --build
-
Apply database migrations:
$ docker compose exec app uv run --no-sync manage.py migrate -
Run the tailwind watch:
$ npm run watch
-
Change DJANGO_ENV to production in the .env file.
-
Build and run the production container:
$ docker compose -f docker-compose.prod.yml up --build -d