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 = [
    'django.middleware.security.SecurityMiddleware',
    '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) when DEBUG-mode is turned off.

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

Configuration

settings.py

DEBUG = False

...

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    '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.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

djangorescue-0.0.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: djangorescue-0.0.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

File hashes

Hashes for djangorescue-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f749fe1a13dc2f1c1532b83053aec0ae78edc8fcdd66307550aeb10d97219aaf
MD5 64c869d8a0d0efecbaef6e00f328a791
BLAKE2b-256 0377070a544bdb5af7b369ada6d03599e487646166ad0017c0c778ce2d6e92b4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: djangorescue-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

File hashes

Hashes for djangorescue-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca74d61ef5de58fe8697c8a29ba7d7510aee0876d41f99db6e73e28646b249fd
MD5 05788e582a0f7f48acb4438f5584e915
BLAKE2b-256 6956ec1d6f1c8093e8559ceee2dec7df78b954f20ac09ae50ef7713d5da71fbf

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