Skip to main content

A plugin for django-simple-deploy, supporting deployments to Railway.

Project description

dsd-railway

A plugin for deploying Django projects to Railway, using django-simple-deploy.

For full documentation, see the documentation for django-simple-deploy.

Current status

This plugin is in a pre-1.0 development phase. It has limited functionality at the moment, but should evolve quickly.

Configuration-only deployment

  • Install the Railway CLI
  • Choose a name for your deployed project, and use it everywhere you see <project-name> Run the following commands:
$ railway login # May need to use `railway login --browserless`
$ pip install dsd-railway
# Add `django_simple_deploy` to `INSTALLED_APPS`
$ python manage.py deploy --deployed-project-name <project-name>
$ git status
# Review changes
$ git add .
$ git commit -m "Configured for deployment to Railway."
  • Run the following. (You'll see a bunch of errors after railway up. Those errors will go away after creating the database. This is Railway's recommended approach!)
$ railway init --name <project-name>
$ railway up
$ railway add --database postgres
$ railway variables \
    --set 'PGDATABASE=${{Postgres.PGDATABASE}}' \
    --set 'PGUSER=${{Postgres.PGUSER}}' \
    --set 'PGPASSWORD=${{Postgres.PGPASSWORD}}' \
    --set 'PGHOST=${{Postgres.PGHOST}}' \
    --set 'PGPORT=${{Postgres.PGPORT}}' \
    --service <project-name>
$ railway domain --port 8080 --service <project-name>

After this last command, you should see the URL for your project. You may need to wait a few minutes for the deployment to finish.

If your deployment does not seem to work, you can try redeploying it:

$ railway redeploy --service <project-name>

Fully automated deployment

  • Install the Railway CLI
  • Log in, using railway login. You may need to run railway login --browserless.
  • Install dsd-railway: pip install dsd-railway
  • Add django_simple_deploy to INSTALLED_APPS
  • Run python manage.py deploy --automate-all.

Your deployed project should appear in a new browser tab.

Destroying a project

This is mostly for developers, but if you're trying this out and want to destroy a project the following should work:

$ export RAILWAY_API_TOKEN=<account-token>
$ python developer_resources/destroy_project.py <project-id>

Be careful running this command, as it is an immediately destructive action. If you want to be more cautious, you can delete the project in your Railway dashboard. Railway schedules the project for deletion in the next 48 hours, giving you some possibility of restoring the project if you need to.

If you don't know the ID of your project, you can run railway status --json. The ID will the first item in the JSON output.

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

dsd_railway-0.1.2.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

dsd_railway-0.1.2-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file dsd_railway-0.1.2.tar.gz.

File metadata

  • Download URL: dsd_railway-0.1.2.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for dsd_railway-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bee14e6aba9e4171649997e93155fbdf01a32cff62ba8f2bbd525c95c65f0c8f
MD5 735236b7275f2b1497aef4fd0727d5b0
BLAKE2b-256 30cf52e126758ae518f0db766daa85043285ba757cd83ff12516ee4c6a833c8a

See more details on using hashes here.

File details

Details for the file dsd_railway-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: dsd_railway-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for dsd_railway-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 be4a5d88d50c457b6afc7526f9b7f7ee753a8fae41b3f14405f1f5bd435292f3
MD5 f7d69f0f1ca524a0c8634590d9e05d94
BLAKE2b-256 9f5fb7d60d8967d5b43ba61709a201bb12c7a377ef4ada2c054df9f44fb0e524

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