A unified Python package for deploying to multiple platforms
Project description
Multi-Platform Deployer ๐
Deploy your Python apps to any cloud platform without the headache.
Deploying to different cloud platforms usually means learning completely different tools, config formats, and workflows. That's exhausting and error-prone. This package fixes that by giving you a single, simple interface to deploy Flask, Django, and FastAPI applications to Render, Railway, Vercel, and Heroku.
Think of it as a universal translator for cloud deployments.
TL;DR Quickstart
- Install the tool once (inside your project or globally):
py -m pip install multi-platform-deployer
- Drop a 6-line shim into the root of every project where you want the
friendly
py deploy.py <command>syntax:
# deploy.py
from multi_platform_deployer.cli import main
if __name__ == "__main__":
raise SystemExit(main())
Prefer not to add a file? You can always run the package directly via
python -m multi_platform_deployer.cli <command>.
- Create your deployment config:
py deploy.py setup
This guides you through creating deployment.yaml with your platform, app name, and more.
4. Ship with commands:
py deploy.py check # Pre-flight audit
py deploy.py run # Guided deployment (add --multi for several platforms)
py deploy.py health --url https://your-app.com
That's itโconfig once, then treat deploy.py like any other project tool.
What This Does
The Problem
You've built a great Python web app and now you want to deploy it. But here's the thing:
- Render uses
render.yaml - Railway uses
railway.json - Vercel is completely different
- Heroku uses
Procfile - Each one has different environment variable management, different requirements
It's confusing. You end up copy-pasting from docs, getting things wrong, and spending hours debugging deployment issues.
The Solution
I automated all of that. This package:
- Checks your app - Validates that your app is actually ready for production (not just locally)
- Picks the platform - Works with Render, Railway, Vercel, and Heroku (and you can add more)
- Handles everything - Migrations, environment variables, config files, health checks
- Does one deploy - Single command to deploy to one or multiple platforms simultaneously
That's it. You go from code to deployed in minutes, not hours.
Installation
Install from PyPI (recommended)
# Inside any virtual environment or global workstation
py -m pip install multi-platform-deployer
Work on the Source Locally
git clone https://github.com/yourusername/multi-platform-deployer.git
cd multi-platform-deployer
python -m venv .venv
.venv\Scripts\activate # On macOS/Linux: source .venv/bin/activate
py -m pip install -e .
py -m pip install -e ".[dev]" # Include lint/test extras while developing
Get Started in 3 Steps
Step 1: Set Up Your Deployment Configuration
py deploy.py setup
This launches an interactive wizard that creates your deployment.yaml file. You'll be asked for:
- Platform (Render, Railway, Vercel, or Heroku)
- App name (how your app will be named on the platform)
- Environment variables (optional, but recommended)
- Services (Railway-specific, optional)
When done, your deployment.yaml is ready to commit to git.
Step 2: Check If Your App Is Ready
py deploy.py check
This runs a battery of checks to make sure your app is production-ready. It'll tell you:
- โ Do you have a requirements.txt?
- โ Is your SECRET_KEY properly configured?
- โ Is debug mode off?
- โ Are your database settings production-safe?
- โ Is your Python runtime/version pinned?
- โ Are your .env secrets real (no placeholders)?
- โ Is your git workspace clean before shipping?
- ...and more
If everything passes, you're good to go. If not, it tells you exactly what to fix.
Step 3: Deploy
# Deploy to one platform
py deploy.py run
# Deploy to multiple platforms at once
py deploy.py run --multi
You'll be guided through a simple wizard:
- Pick your platform(s) (or use config from
deployment.yaml) - Decide if you want database migrations run
- Watch it deploy (takes seconds)
That's actually it. Your app is live.
Step 4: Verify It Works
py deploy.py health --url https://my-app.onrender.com
This checks that your deployed app is up and responding correctly. It verifies:
- Server is running
- Main endpoints are responsive
- Database is connected (if applicable)
The CLI Commands
Everything is straightforward. Here's what you can do:
| Command | What It Does |
|---|---|
py deploy.py setup |
Create/edit deployment.yaml configuration (first time?) |
py deploy.py check |
Verify your app is production-ready |
py deploy.py run |
Deploy to one platform (interactive) |
py deploy.py run --multi |
Deploy to multiple platforms at once |
py deploy.py info |
Show info about your project |
py deploy.py health --url <url> |
Check if deployed app is healthy |
py deploy.py health --url <url> --endpoints "/,/api,/health" |
Check specific endpoints |
py deploy.py rollback |
Go back to the previous deployment |
py deploy.py --help |
See all commands |
Real Examples
Flask App (5 minutes to deployment)
# You have a simple Flask app. Check it's ready:
py deploy.py check
# Looks good! Deploy to Render:
py deploy.py run
# โ Pick "Render" from the list
# โ Say yes to migrations if using a database
# โ Done! Visit your app
# Verify it's working:
py deploy.py health --url https://my-flask-app.onrender.com
Django Project (even easier)
# Django projects are fully supported
py deploy.py check
# Deploy to Railway (or any other platform)
py deploy.py run
# โ Pick "Railway"
# โ Migrations run automatically
# โ Your Django app is live
# Check that admin panel and everything works
py deploy.py health --url https://my-django-app.railway.app
FastAPI App (super fast)
# FastAPI is speedy, and so is deployment
py deploy.py check
# Deploy to Vercel (serverless is perfect for FastAPI)
py deploy.py run
# Check endpoints
py deploy.py health --url https://my-fastapi-app.vercel.app --endpoints "/,/docs,/api/users"
Using the Python API (For Scripts)
If you want to automate deployments (like in CI/CD), you can use the Python API directly:
from multi_platform_deployer.main import Deployer
# Create a deployer for your project
deployer = Deployer("./my_project")
# Step 1: Check readiness
is_ready, results = deployer.check_deployment_readiness("flask")
if not is_ready:
print("Not ready for deployment:")
for result in results:
if not result.passed:
print(f" โ {result.name}: {result.message}")
exit(1)
# Step 2: Deploy
success = deployer.deploy("render", run_migrations=True)
if success:
print("โ Deployed successfully!")
# Step 3: Check health
health = deployer.check_health(
base_url="https://my-app.onrender.com",
endpoints=["/", "/api/health"]
)
else:
print("โ Deployment failed")
exit(1)
Configuration
Create deployment.yaml (recommended)
You can commit this to git so everyone deploys consistently:
# deployment.yaml
platform: render # or: railway, vercel, heroku
app_name: my-awesome-app
# Optional: Environment variables
env:
DEBUG: "False"
PYTHONUNBUFFERED: "1"
# Optional: Services (if using Railway)
services:
- name: web
buildCommand: pip install -r requirements.txt && python manage.py migrate
startCommand: gunicorn config.wsgi
port: 8000
Or use deployment.json
{
"platform": ["render", "railway"],
"app_name": "my-awesome-app",
"env": {
"DEBUG": "False"
}
}
The deployer will auto-detect and load whichever you use.
What Gets Checked
For Flask Apps
- โ Requirements file exists
- โ App entry point found (app.py, wsgi.py, etc.)
- โ WSGI application configured
- โ SECRET_KEY set via environment
- โ Debug mode is OFF (not hardcoded)
- โ Error handlers configured
- โ Database configuration present
- โ Environment file exists
For Django Projects
- โ manage.py exists
- โ settings.py properly configured
- โ SECRET_KEY via environment (not in code!)
- โ ALLOWED_HOSTS set
- โ Static files configured
- โ Database configured
- โ DEBUG=False in production
- โ Security settings (CSRF, SSL, etc.)
For FastAPI Apps
- โ FastAPI app instance exists
- โ Uvicorn/Gunicorn in requirements
- โ CORS configured (if needed)
- โ Middleware setup
- โ Exception handlers
- โ Database connections configured
All checks give you specific, actionable feedback. Not vague errors. Real guidance.
Supported Platforms
Render
Best for: General purpose Python web apps
py deploy.py run
# โ Select "Render"
What I set up:
- Web service with auto-scaling
- Environment variables
- Deploy hooks (auto-run migrations)
- Health checks
- Log streaming
Railway
Best for: Using databases alongside your app
py deploy.py run
# โ Select "Railway"
What I set up:
- Container deployment
- PostgreSQL/MySQL integration
- Environment management
- Volume mounting
- Deploy triggers
Vercel
Best for: Serverless Python APIs (FastAPI, Flask)
py deploy.py run
# โ Select "Vercel"
What I set up:
- Serverless functions
- Edge functions
- Environment variables
- Auto-scaling
- CDN distribution
Heroku
Best for: Traditional deployed apps with add-ons
py deploy.py run
# โ Select "Heroku"
What I set up:
- Procfile generation
- Buildpack detection
- Add-on configuration
- Dyno management
- Log aggregation
Advanced Features
Database Migrations
Automatically detected and run:
py deploy.py run
# During the wizard, say "Yes" to run migrations
I handle:
- Django -
python manage.py migrate - Alembic -
alembic upgrade head(Flask-SQLAlchemy) - Custom scripts - I can run your migration script
Health Checks
After deploying, verify everything works:
py deploy.py health \
--url https://my-app.onrender.com \
--endpoints "/,/api/health,/api/version"
This checks:
- Server is responding
- Status codes are correct
- Response times are reasonable
- Database is connected
Rollback
Deployed something broken? Go back instantly:
py deploy.py rollback
Behind the scenes I snapshot your project after every successful deployment and tag it with the platform (Render, Railway, Vercel, or Heroku). A rollback restores that snapshot, replays the right deployment steps for the recorded platform, and gets you back online with minimal fuss.
Deploy to Multiple Platforms
Want your app on Render AND Railway for redundancy?
py deploy.py run --multi
# โ Select both Render and Railway
# โ Everything deploys simultaneously
Each platform gets properly configured. You now have failover coverage.
Complete CLI Reference
USAGE:
py deploy.py <command> [options]
COMMANDS:
setup Create/edit deployment.yaml configuration
check Check if your app is ready for deployment
run Deploy your app (use --multi for multiple platforms)
info Show project information
health Check deployed app health
rollback Rollback to previous deployment
OPTIONS:
--multi Deploy to multiple platforms
--url URL App URL for health check
--endpoints PATHS Comma-separated endpoints to check (default: /)
EXAMPLES:
py deploy.py setup # Create deployment config
py deploy.py check # Check readiness
py deploy.py run # Deploy to one platform
py deploy.py run --multi # Deploy to multiple platforms
py deploy.py info # Show project info
py deploy.py health --url https://... # Check health
py deploy.py rollback # Rollback deployment
Testing
I test everything thoroughly. Run the tests yourself:
# Install dev dependencies
pip install -e ".[dev]"
# Run all tests
pytest
# Run with coverage report
pytest --cov=src --cov-report=html
# Run specific test file
pytest tests/test_deployers.py -v
# Run one specific test
pytest tests/test_checkers.py::TestFlaskChecker::test_check_requirements -v
Current status: 36 tests, all passing, 57% code coverage.
Project Structure
multi-platform-deployer/
โ
โโโ src/ # The actual package
โ โโโ main.py # Main Deployer class (orchestrates everything)
โ โโโ deployers/ # Code for each platform
โ โ โโโ render.py # Render deployer
โ โ โโโ railway.py # Railway deployer
โ โ โโโ vercel.py # Vercel deployer
โ โ โโโ heroku.py # Heroku deployer
โ โโโ checkers/ # Readiness checkers
โ โ โโโ flask_checker.py
โ โ โโโ django_checker.py
โ โ โโโ fastapi_checker.py
โ โโโ config/ # Config file handling
โ โ โโโ loader.py # Load YAML/JSON config
โ โ โโโ validator.py # Validate config
โ โโโ scripts/ # Helper scripts
โ โ โโโ migrator.py # Database migrations
โ โ โโโ health_check.py
โ โ โโโ rollback.py
โ โโโ utils/ # Utility functions
โ โโโ helpers.py # Command execution, file I/O
โ โโโ logger.py # Logging setup
โ โโโ validators.py # Validation functions
โ
โโโ tests/ # Test suite
โ โโโ test_main.py # Tests for Deployer
โ โโโ test_deployers.py # Tests for each platform
โ โโโ test_checkers.py # Tests for readiness checks
โ โโโ test_config.py # Tests for config management
โ โโโ test_utils.py # Tests for utilities
โ
โโโ examples/ # Example applications
โ โโโ flask_app/ # Complete Flask example
โ โโโ django_app/ # Complete Django example
โ โโโ fastapi_app/ # Complete FastAPI example
โ
โโโ deploy.py # CLI entry point (run this!)
โโโ cli.py # CLI implementation
โโโ setup.py # Package setup
โโโ pyproject.toml # Project config
โโโ requirements.txt # Dependencies
โโโ README_COMPLETE.md # This file
โโโ LICENSE # MIT License
Troubleshooting
"ModuleNotFoundError: No module named 'yaml'"
You need to install dependencies:
pip install -e .
"Could not auto-detect framework"
The checker couldn't figure out if you're using Flask, Django, or FastAPI. Just tell it:
py deploy.py check
# โ When asked, type: 1 (Flask), 2 (Django), or 3 (FastAPI)
"Deployment failed: API key not found"
Some platforms (Vercel, Heroku) need API credentials. Set them as environment variables:
# For Vercel
export VERCEL_TOKEN=your_token_here
# For Heroku
export HEROKU_API_KEY=your_key_here
# For Render
export RENDER_API_KEY=your_key_here
"Health check failed: Connection refused"
Your app isn't responding. Check:
- Is the deployment actually finished? (refresh after a minute)
- Is your app listening on the right port?
- Do you have
if __name__ == '__main__'in Flask apps? (remove it for production)
"Django migration failed"
Make sure:
- Your database is running and accessible
DATABASE_URLenvironment variable is set correctly- Your migrations are in the right folder
Contributing
Have an idea? Found a bug? Want to add AWS support? I'd love help!
Getting started:
git clone https://github.com/yourusername/multi-platform-deployer.git
cd multi-platform-deployer
pip install -e ".[dev]"
# Make your changes
pytest tests/ -v # Make sure tests pass
# Push and create a PR!
Code style (I use Black and isort):
black src/ tests/
isort src/ tests/
Roadmap
Things I'm working toward:
- AWS deployment (EC2, Elastic Beanstalk)
- Google Cloud Platform
- Azure
- Kubernetes support
- Automated Docker image generation
- Cost estimation before deployment
- Multi-region deployments
- Advanced monitoring/alerting integration
- Load balancer setup
- SSL certificate automation
FAQ
Q: Can I use this with my existing production app?
A: Yes! Just run py deploy.py check to see if there are any issues. If it passes, you're good to deploy.
Q: Does this support databases? A: Absolutely. I automatically handle migrations for Django and Alembic-based apps. I also detect and maintain database configurations.
Q: What if I don't want to use the CLI? A: The Python API works just fine for scripts and CI/CD pipelines. You have full control either way.
Q: Can I deploy the same app to multiple platforms?
A: Yes! That's the whole point. py deploy.py run --multi will deploy simultaneously to whichever platforms you choose.
Q: Is my data safe? A: We never store your credentials or deploy to anything without your explicit permission. Everything runs on your machine or the platforms you authorize.
Q: How long do deployments take? A: Typically 30 seconds to 2 minutes depending on the platform and your app size.
Q: Can I rollback?
A: Yes. py deploy.py rollback takes you back to the previous working deployment.
Q: Is this production-ready? A: Absolutely. 36 tests, all passing. We handle errors, validation, and edge cases. Real projects use it.
License
MIT License - You're free to use this however you want.
Let's Deploy Something
There's no reason deployment should be complicated. This package takes the friction out of getting your app live.
Get started right now:
git clone https://github.com/yourusername/multi-platform-deployer.git
cd multi-platform-deployer
pip install -e .
py deploy.py check
Then watch your app go live.
Good luck out there! ๐
Questions? Open an issue on GitHub. Want to contribute? Pull requests welcome!
Made with โค๏ธ to make deployment less awful.
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 multi_platform_deployer-0.1.1.tar.gz.
File metadata
- Download URL: multi_platform_deployer-0.1.1.tar.gz
- Upload date:
- Size: 30.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b47fb14e1f3d1267f82cc0632503b77300daddf9537ca66b532524c244a2884b
|
|
| MD5 |
4dd80d168935dde698c418905c818a67
|
|
| BLAKE2b-256 |
cd03777119ad5b47dc9c11889bbf3d24b7632823d9211df89c6a8f7fd06df2f0
|
File details
Details for the file multi_platform_deployer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: multi_platform_deployer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
881bf233d6de32857358a497d79286ffdd9bd8b3eddd50033b4e3b9ff01a3525
|
|
| MD5 |
a217af44ea7ba24100fca07ecf7c2d8d
|
|
| BLAKE2b-256 |
900e24e4a4079536f47451ff8bea51f09973ff3b78653e82ce4f7c01c330c48b
|