Django with Volume Support

Django with Volume Support

Use Railway Volumes with Django

Deploy Django with Volume Support

django-volumes

railwayapp-templates/django-volume

Just deployed

/app/media

Postgres

railwayapp-templates/postgres-ssl:latest

Just deployed

/var/lib/postgresql/data

Django with Volume Support Example

This example template starts a Django server utilizing volume support on Railway for storing and serving assets.

✨ Features

  • Django
  • Railway Volumes
  • Python 3

💁‍♀️ How to use

  • Clone locally and install packages with pip using pip install -r requirements.txt
  • Run locally using python manage.py migrate && python manage.py collectstatic --noinput && gunicorn mysite.wsgi

📝 Troubleshooting

If you get the following error No such file or directory: '/app/media/directory/...' make sure your directory exists since your folder structure has to be build from scratch for production purpose on the persistent storage.

You can use something like this:

new_directory = os.path.join(settings.MEDIA_ROOT, 'directory')
if not os.path.exists(new_directory):
  os.makedirs(new_directory)

Template Content

More templates in this category

New

mellow-vue

mellow-vue

A full-stack Vue app with The Boring JavaScript Stack.


0

New

.NET8 Web API

.NET8 Web API

A basic ASP.NET Core Web API template (.NET 8)


0

New

Django Monolith

Django Monolith

A Django app connected to a Postgres database with Celery and Celery Beat.


0