Skip to main content

Package to let you serve static and media files via Django pipeline with DEBUG = False.

Project description

DJANGORESCUE

Описание по-русски.

Пакет DJANGORESCUE позволяет обслуживать статику (static, media) через Django (когда нет возможности использовать nginx, apache, и s3 storage), независимо от состояния параметра DEBUG.

Да, это известно, что так делать не следует, но иногда по-другому нельзя.

Конфигурация

settings.py

DEBUG = False

...

MIDDLEWARE = [
    ...
    'djangorescue.middleware.StaticMediaMiddleware',
	...
]

...

STATIC_URL = '/static/'
STATIC_APP_DIR = 'static' # Имя каталога со статикой внутри каталога приложения.

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

English description.

DJANGORESCUE package allows to serve static files (static, media) through Django (when nginx, apachage and s3 storage options are not available) regardless of DEBUG setting value.

Yes, it is a known thing, that such approach is bad, however sometimes it's the only way.

Configuration

settings.py

DEBUG = False

...

MIDDLEWARE = [
    ...
    'djangorescue.middleware.StaticMediaMiddleware',
	...
]

...

STATIC_URL = '/static/'
STATIC_APP_DIR = 'static' # The name of the folder, that contains static files within the app folder.

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

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

djangorescue-0.0.3.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

djangorescue-0.0.3-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file djangorescue-0.0.3.tar.gz.

File metadata

  • Download URL: djangorescue-0.0.3.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for djangorescue-0.0.3.tar.gz
Algorithm Hash digest
SHA256 10747a3b821387a1063d893de3c924e160dd201b03033f1c05c35d5942b5f9ec
MD5 ad8d206528c0abf05752c8e8541cac09
BLAKE2b-256 06db85eed90c69abf2de41f5733695768b635fa8fab77ec6c44422334cbf6c9f

See more details on using hashes here.

File details

Details for the file djangorescue-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: djangorescue-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for djangorescue-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0058168cae2469d8d4c9bf2e687fe2386df18a8ee9b7b862483c15af69031f1f
MD5 e75d426e9ce3c3c42aa450f9deee3b65
BLAKE2b-256 311c5ec103cd0e3c27071efd6271d66912a793c13e51ffa9596c85f10d065940

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page