Skip to content

homeGrownCheese/Railway_Django

Repository files navigation

Railway Django

A Django 6.0 project configured for deployment on Railway with PostgreSQL, Gunicorn, and WhiteNoise.

Tech Stack

  • Python 3.12
  • Django 6.0
  • PostgreSQL (via dj-database-url)
  • Gunicorn (WSGI server)
  • WhiteNoise (static files)

Local Setup

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env  # then edit with your values
python manage.py migrate
python manage.py runserver

Environment Variables

Variable Description Example
SECRET_KEY Django secret key (generate a random key)
DEBUG Enable debug mode True or False
ALLOWED_HOSTS Comma-separated hostnames localhost,127.0.0.1
CSRF_TRUSTED_ORIGINS Comma-separated origins https://your-app.up.railway.app
DATABASE_URL Database connection string postgresql://user:pass@host:5432/db

Deployment (Railway)

  1. Push to a GitHub repo
  2. Connect the repo in Railway
  3. Add a PostgreSQL service and link it to the app
  4. Set environment variables in Railway's dashboard
  5. Railway auto-detects the Procfile and railway.json

About

A Django Project Template For Railway

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •