A free command-line tool to simplify Django project deployment in production environments
Project description
Djanbee
A free command-line tool to simplify Django project deployment in production environments.
Overview
Djanbee automates the critical configuration steps needed to transition a Django application from development to production. Available through the pip package manager, Djanbee handles server setup, environment configuration, Django settings optimization, and deployment - all from a simple command-line interface.
Installation
pip install djanbee
Requirements
- Python 3.6+
- pip
- Django project
- Linux/Ubuntu environment
Features
Djanbee executes the following deployment tasks in sequence:
1. Launch
- Initializes server deployment
- Creates and configures socket files for the Django process with Gunicorn
- Generates optimized Nginx configuration files for serving the application
2. Setup
- Automatically locates and validates Django project structure
- Creates isolated Python environment with venv
- Installs all dependencies from requirements.txt
3. Configure
- Modifies settings.py to set DEBUG=False
- Configures ALLOWED_HOSTS and security settings
- Sets up database configuration for production use
- Generates secure SECRET_KEY
4. Deploy
- Transfers files to production location (/var/www/[domain_name]/)
- Sets appropriate permissions for production environment
- Configures Nginx and Gunicorn for the Django application
5. Run
- Executes Django's collectstatic command to gather static files
- Runs database migration commands to set up the database schema
Server Architecture
Djanbee implements the industry-standard server architecture for Django applications:
Client requests → Nginx → Gunicorn → Django application
- Nginx: Handles client connections, SSL, static files, and acts as a buffer to the internet
- Gunicorn: Runs Python/Django code efficiently with multiple workers
Command Reference
Basic Command Syntax
django-djanbee [command] [options]
Commands
| Command | Description |
|---|---|
| djanbee | Display help information and available commands |
| launch | Initialize Django server deployment by setting up Gunicorn socket and Nginx configuration |
| setup | Create and configure virtual environment and install project dependencies |
| configure | Modify Django settings.py for production and prepare database configuration |
| deploy | Copy Django project and dependencies to web server directory |
| run | Execute final deployment steps including database migrations and static file collection |
Options
| Option | Description | Used With |
|---|---|---|
| --help | Show the help message and exit | All commands |
| -s | Open the settings.py editing menu for production configuration | configure |
Example Usage
Complete Deployment Process
To run the complete deployment process:
djanbee launch
djanbee setup
djanbee configure
djanbee deploy
djanbee run
Production Environment
After deployment, Djanbee creates the following structure:
/var/www/[domain_name]/
├── application/ # Your Django project files
│ ├── manage.py
│ ├── yourproject/
│ └── ...
├── env/ # Virtual environment
│ ├── bin/
│ ├── lib/
│ └── ...
├── static/ # Collected static files
└── media/ # User uploaded files
Database Support
Currently, Djanbee is optimized for PostgreSQL with peer authentication, which:
- Uses the operating system's username to authenticate automatically
- Eliminates password management
- Provides enhanced security for local connections
- Simplifies deployment
Security Notes
- Settings.py is modified before deployment for production-ready security
- File permissions are properly set (644 for files, 755 for directories)
- Socket file has 660 permissions owned by www-data group
- Static/media directories have 755 permissions with www-data ownership
Contributing
We welcome contributions to Djanbee! Here's how to get started:
Quick Start
- Fork the repository and clone your fork
- Create a new branch:
git checkout -b feature/your-feature - Make your changes following PEP 8 standards
- Test thoroughly on Linux/Ubuntu environments
- Commit with clear messages:
git commit -m "Add: description" - Push and create a Pull Request
What We Need
- Bug fixes for deployment issues
- New server configurations (Apache, different setups)
- Database support improvements (MySQL, SQLite)
- Documentation and security enhancements
- Cross-platform support
Reporting Issues
Include your OS, Python version, Django version, and error logs when reporting bugs.
Questions? Open an issue or reach out to maintainers. Thanks for helping improve Djanbee! 🐝
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_djanbee-0.1.0.tar.gz.
File metadata
- Download URL: django_djanbee-0.1.0.tar.gz
- Upload date:
- Size: 70.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6bee14efe940ba860bada916cbe599636e278501dca5ca815e71a6f812d0688
|
|
| MD5 |
3439d9ccee5f43d2cf5ed791ef42206a
|
|
| BLAKE2b-256 |
c204133dded4c7168789fcfdd018aeb353ead49cb1bbb6a6ed863d9ac34cda36
|
File details
Details for the file django_djanbee-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_djanbee-0.1.0-py3-none-any.whl
- Upload date:
- Size: 106.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be737c680177db5440e4421d440b1d199cd3861038806420ed9887a593aee77e
|
|
| MD5 |
3c8bca3efc29cc8d5e22ccbefd089cce
|
|
| BLAKE2b-256 |
2ca606accf003f0ffaec14669773cbff7adf84de7de00c26a7d7e09e23d52e4c
|