How ixc/ixc-django-docker works
Main Components
• Wrapped Django Project Template: Represent the “wrapped” Django application (as seen under project_template/djangosite) that gets imbued with additional functionality from the wrapper.
• Supporting Services: External systems that the project requires:
• Database (PostgreSQL)
• Cache and message brokers (Redis)
• Asynchronous task workers (Celery; see the “celery” subpackage and various celery-related scripts)
• Web Server (Nginx, with gunicorn used to serve the app in production)
• Optional external services like Elasticsearch, Supervisor, and possibly Transcrypt used for encrypted secrets.
Relationships and Interactions
• Incoming requests flow from external clients to the web server (Nginx) which proxies traffic to Gunicorn, starting the Django application (ixc_django_docker).
• The main Django wrapper component interacts with the wrapped project’s settings, templates, and URLs. This layering encapsulates the main project-specific logic with shared best practices.
• Configuration scripts and shell commands (found in the “bin” directory) sit at the orchestration layer. They initiate processes such as migrations, static file compilation, running the server, etc.
• When running with Docker, the Docker Compose file becomes the orchestrator of the various containerized services (web, DB, cache, etc.). Highlight directional flows in that layered architecture.
• For local runs, the “go.sh” script sets up the environment so that the same underlying services are reachable even if managed individually (use of Brew services on macOS, for example).
Architectural Patterns and Design Principles
• Layered Architecture: Separate the concerns of configuration/environment orchestration (i.e., Docker vs. local execution) from the Django application’s business logic.
• Composable Settings: The use of modular settings (in ixc_django_docker/settings) shows a pattern where different environment configurations (production, staging, test, etc.) are composed based on environment variables. This is key to the project’s flexibility and must be clearly annotated.
• “Wrapper” Pattern: The Django project wrapper enables “wrapping” a standard Django project to add cross-cutting functionalities (logging, secrets handling, monitoring, etc.). This abstraction layer should be highlighted.
Specific Technologies, Frameworks, and Tools
• Django and its settings infrastructure for web application logic.
• Celery for asynchronous task processing.
• Gunicorn as the WSGI server.
• Nginx as the reverse proxy and static file server.
• Redis as a caching mechanism and for task queue communication.
• Postgres as the underlying relational database.
• Docker and Docker Compose for container management.
• Transcrypt for handling encrypted secrets.
• Various shell scripts that standardize operations (e.g., migration, testing, building static assets).
• Optional tools such as ddtrace, haystack (with Elasticsearch), and supervisor for process management.
Final Assembly
• At the core, illustrate your Django application split into its two main parts: the “wrapper” (handling cross-cutting concerns and shared settings) and the “wrapped project” that holds the business-specific logic.
• Finally, attach all service dependencies to this core which the Django application interacts with.