Skip to main content

Automated Django deployment tool for EC2 with PostgreSQL, Nginx, and Gunicorn

Project description

YeleDeploy

Automated Django deployment tool for EC2 with PostgreSQL, Nginx, and Gunicorn.

Features

  • Safe Database Operations: Only creates new databases, never drops existing ones
  • Swagger Documentation Support: Properly configures static files for API documentation
  • Automated SSL Setup: Configures HTTPS with Let's Encrypt
  • Service Management: Sets up systemd services for reliable operation
  • Comprehensive Logging: Structured logging with monitoring tools
  • Security Configuration: Firewall setup and proper permissions

Installation

pip install yeledeploy

Usage

Deploy a new application

yeledeploy deploy

This will prompt you for:

  • App name (used for service naming)
  • Domain name
  • Project directory name
  • Django project module name
  • Database name
  • Database password

Update existing deployment

yeledeploy update --app-name myapp

Monitor logs

yeledeploy logs --app-name myapp

Prerequisites

  • Ubuntu EC2 instance with sudo access
  • Git repository with Django project
  • Domain name pointing to your EC2 instance

Project Structure

Your Django project should be cloned to /home/ubuntu/ and have:

  • requirements.txt file
  • Standard Django project structure with manage.py
  • Proper Django settings configuration

Database Handling

YeleDeploy safely handles databases by:

  1. Checking if the specified database already exists
  2. Only creating new databases if they don't exist
  3. Never dropping or modifying existing databases
  4. Supporting multiple databases on the same PostgreSQL instance

Static Files & Swagger

The tool properly configures static file serving including:

  • Django static files collection
  • Swagger/OpenAPI documentation assets
  • Media files handling
  • Proper Nginx configuration for all static content

Environment Variables

You can provide a .env file or the tool will create a basic template with:

  • Database configuration
  • Django settings
  • Static/media file paths
  • Swagger configuration

Service Management

After deployment, manage your application with:

# Restart application
sudo systemctl restart gunicorn-<app-name>.service

# View logs
sudo journalctl -u gunicorn-<app-name>.service -f

# Check status
sudo systemctl status gunicorn-<app-name>.service

File Locations

  • Project: /home/ubuntu/<project-dir>/
  • Logs: /var/log/gunicorn/<app-name>-*.log
  • Nginx Config: /etc/nginx/sites-available/<app-name>
  • Service: /etc/systemd/system/gunicorn-<app-name>.service

Development

To install for development:

git clone <repository>
cd yeledeploy
pip install -e .

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yeledeploy-1.0.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yeledeploy-1.0.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file yeledeploy-1.0.0.tar.gz.

File metadata

  • Download URL: yeledeploy-1.0.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for yeledeploy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6fb9bd83377cda222fc8315129b0fcc3ffa1feacd3ed19d92d0fefcbaa7563a6
MD5 11838ca7383112bc3b0da8cf90e7eced
BLAKE2b-256 d20dde32e9c4b7aae3f58441c5634a063868701a898d69c229279031463832d2

See more details on using hashes here.

File details

Details for the file yeledeploy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: yeledeploy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for yeledeploy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54cef60cacf96e0819142aea63e0291d79bc0be718a44714335348bd674d4af4
MD5 4e54816fa94803a28650d3675939b13d
BLAKE2b-256 759fcb720e6119cfd9bff45a2b8c2605b29ef4582a3862ff7f8e4c1faa9b005b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page