Skip to main content

django-railway-storage

A Django package that provides Railway bucket storage backends and a management command to auto-configure your settings.

Installation

pip install django-railway-storage

Add to INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'django_railway_storage',
]

Usage

Auto-configure settings

Run the management command to append the storage config to your settings file:

# Private storage (presigned URLs, default)
python manage.py configure_railway_storage

# Public storage
python manage.py configure_railway_storage --storage public

# Custom settings file path
python manage.py configure_railway_storage --settings-file config/settings/production.py

# Custom presigned URL expiry (seconds)
python manage.py configure_railway_storage --storage private --expire 7200

Required environment variables

Set these in your Railway project (or .env):

Variable Description
AWS_ACCESS_KEY_ID Railway bucket access key
AWS_SECRET_ACCESS_KEY Railway bucket secret key
AWS_STORAGE_BUCKET_NAME Bucket name
AWS_S3_ENDPOINT_URL Railway S3-compatible endpoint URL
AWS_S3_REGION_NAME Region (default: us-east-1)

Use backends directly

You can also reference the backends manually in your settings:

# Private (presigned URLs)
STORAGES = {
    "default": {
        "BACKEND": "django_railway_storage.backends.PrivateMediaStorage",
    },
    ...
}

# Public
STORAGES = {
    "default": {
        "BACKEND": "django_railway_storage.backends.PublicMediaStorage",
    },
    ...
}

Use on a model field

from django.db import models

class Document(models.Model):
    file = models.FileField(upload_to='documents/')  # uses default storage

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_railway_storage-1.0.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

django_railway_storage-1.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file django_railway_storage-1.0.0.tar.gz.

File metadata

  • Download URL: django_railway_storage-1.0.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for django_railway_storage-1.0.0.tar.gz
Algorithm Hash digest
SHA256 198571c6dafa4cfc227a19f608d8880d25615ab1534f89b12ef583779cf3ef8f
MD5 c30edf07282ab6e451f5fdd906bc5203
BLAKE2b-256 ece847d3ea249eb1eda95d802cd469e679e416e251b64f269a1498b13b1ec8a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_railway_storage-1.0.0.tar.gz:

Publisher: ci.yml on Franklinson/Railway-Storage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_railway_storage-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_railway_storage-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b348030f31a3fbbb738ea26fbd6e274840550b16686b34017f9fd76356b2899a
MD5 6600c4caedfde40c8c71600a792ab71f
BLAKE2b-256 54c9ab59f028c2519f9b79b424e8782da7825e90da41a8247bafadce949bde60

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_railway_storage-1.0.0-py3-none-any.whl:

Publisher: ci.yml on Franklinson/Railway-Storage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page