Skip to main content

Overview

This example shows how to configure envcheck for a Django project. It validates Python version, package management tools, required environment variables with pattern validation, and Django-specific files.

Configuration

.envcheck.yaml

What This Checks

Tools

  • python >=3.9.0: Ensures compatibility with modern Python features and Django 4.x requirements
  • pip: Validates Python package manager is available for dependency installation
  • docker (optional): Checks for Docker if you’re using containerized databases or services

Environment Variables

  • SECRET_KEY (required): Django’s cryptographic signing key - must be set for security
  • DATABASE_URL (required): Database connection string (e.g., postgres://user:pass@localhost/db)
  • DEBUG (optional): When set, validates it matches boolean patterns (True/False/1/0)

Ports

  • 8000: Django’s default development server port - ensures it’s available for python manage.py runserver

Files

  • manage.py: Django’s management script - confirms you’re in a Django project root
  • requirements.txt: Python dependencies file for reproducible environments
  • .env (optional): Environment file - recommended but not required

Expected Output

Tips for Django Projects

Generate a strong SECRET_KEY using Django’s utility:
Never commit your SECRET_KEY to version control. Use environment variables or .env files (added to .gitignore).
The pattern validation for DEBUG ensures only valid boolean values are used, preventing common mistakes like setting DEBUG=yes.

Common Variations

Django REST Framework API

Add API-specific environment checks:

Celery Task Queue

Validate async task infrastructure:

Production Deployment

Add production-specific requirements:

Poetry Projects

For projects using Poetry instead of pip:

Learn More