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.2.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: djangorescue-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 20997243d2e1a87dc90ce459f6c7cfbe20ef4c75b24eeccb90a694b06c232cca
MD5 2ef09d76e861797b006fef0fdd03036f
BLAKE2b-256 dbfdc0a6b78c63222e45545225c9477fee2693617b73bd78c525aa052c3ea87a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: djangorescue-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 053bca79d8255b3c8a2ce3f528850bcb9b579a0387f3d6768f9ed82411281679
MD5 8e6bcc2ce34d8c44834f3a4ad3fdda9e
BLAKE2b-256 725c57050f236552e0cd491b71ccd07dc5b586ed9b624de7e152d976c98d4266

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