Dev Snippet Generator
Stateless generator — no uploads, no server disk writes. Share via URL.
How to use
- Choose stack/options on the left.
- Click Generate to update snippets.
- Use Copy or Download (download happens in your browser only).
- Share the URL — it recreates the same output.
Choosing a preset reloads the page with parameters (no server storage).
README.md
.env.example
Dockerfile
docker-compose.yml
.github/workflows/ci.yml
deploy/gunicorn.conf.py
deploy/systemd/gunicorn.service
deploy/DEPLOY-VPS.md
version: "3.9"
services:
web:
build: .
container_name: app_web
env_file: .env
depends_on:
- db
command: ["python", "manage.py", "runserver", "0.0.0.0:8000"]
ports:
- "8000:8000"
db:
image: postgres:16-alpine
container_name: app_db
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
pgdata:
Active: docker-compose.yml
Tip: share this page URL to share the exact config.
Deployment help
Quick steps (copy/paste friendly)
2) Environment
Copy
.env.example to .env and set: SECRET_KEY, DEBUG=0, ALLOWED_HOSTS,
DATABASE_URL (if Postgres), REDIS_URL (if Celery/Redis).
3) Migrate + collectstatic
source venv/bin/activate python manage.py migrate python manage.py collectstatic --noinput
4) systemd services
Copy:
-
deploy/systemd/gunicorn.service→/etc/systemd/system/mofidtech_app.gunicorn.service -
If Celery enabled:
deploy/systemd/celery.service→/etc/systemd/system/mofidtech_app.celery.service
sudo systemctl daemon-reload sudo systemctl enable mofidtech_app.gunicorn sudo systemctl start mofidtech_app.gunicorn
5) Nginx host config
Use the generated
nginx/nginx.conf as template:
sudo cp nginx/nginx.conf /etc/nginx/sites-available/mofidtech_app
sudo ln -s /etc/nginx/sites-available/mofidtech_app /etc/nginx/sites-enabled/mofidtech_app
sudo nginx -t && sudo systemctl reload nginx
6) SSL
If you selected LetsEncrypt notes, open
nginx/README-ssl.md.
1) Create folder & venv
sudo mkdir -p /var/www/mofidtech_app
sudo chown -R $USER:$USER /var/www/mofidtech_app
cd /var/www/mofidtech_app
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
2) systemd
-
deploy/systemd/uvicorn.service→/etc/systemd/system/mofidtech_app.uvicorn.service
sudo systemctl daemon-reload sudo systemctl enable mofidtech_app.uvicorn sudo systemctl start mofidtech_app.uvicorn
3) Nginx
Use
nginx/nginx.conf as template (proxy to 127.0.0.1:8000).