A template for creating bots with a server and admin panel. Based on aiogram and django.
This Django API Template is designed to be robust, scalable, and secure, with features that cater to modern application development needs. Here’s an overview of the advanced features and how they benefit your project:
Docker & Docker Compose Integration: Easily set up and scale your application using Docker containers, ensuring consistent environments across development and production.
Celery with RabbitMQ and Redis: Leverage Celery for asynchronous task processing, using RabbitMQ as a message broker and Redis as a backend for storing results.
Sentry for Error Tracking: Integrate with Sentry for real-time error tracking and monitoring, helping you identify and fix issues rapidly.
Django Rest Framework (DRF): Use Django Rest Framework for building RESTful APIs, with support for authentication, serialization, and more.
Django CORS Headers: Use Django CORS Headers for handling Cross-Origin Resource Sharing (CORS) headers, with support for customizing origins.
Django Silk for Profiling: Utilize Django Silk for profiling and monitoring Django applications, offering insights into performance and optimization.
Django Axes for Security: Use Django Axes for security, with support for blocking brute force attacks and monitoring login attempts.
AWS S3 Integration: Option to use Amazon S3 for static and media file storage, enhancing scalability and performance.
Scalability Options: Configure workers and threads to optimize performance under different load conditions.
Up-to-Date Dependencies: All dependencies are up-to-date as of the latest release. Thanks to Dependabot.
The .env
file is a central place to manage environment variables. It’s pre-configured to work with Docker Compose out of the box, without any changes required for initial setup. However, for production deployment, certain secrets must be updated for security reasons.
Secrets:
Ports:
Performance Tuning:
Application Settings:
DJANGO_DEBUG
to false
in production.LANGUAGE_CODE
and TIME_ZONE
as per your requirements.CORS and CSRF Settings:
Database Configuration:
DATABASE_URL
variable.By following this guide and utilizing the advanced features, you’ll be able to set up a powerful, efficient, and secure Django API environment. Happy coding!
python3.12 -m venv .venv
source .venv/bin/activate
cp .env.example .env
pip install -r requirements-dev.txt
make migrate
make run.server.local
make run.bot.local
.env
file.docker compose up -d