Registry / web-framework / django-settings-export

django-settings-export

JSON →
library1.2.1pypypiunverified

Django app that allows you to export certain settings to templates via a context processor. Current version 1.2.1. Low maintenance; last release 2020-06-01.

pip install django-settings-export
INSTALL
IMPORT
SIG · DJANGO-SETTINGS-EX
D
django-settings-export
web-frameworkpythonv1.2.1
Install
4.3s avg
Import
Disk
66MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 67.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.3s · import 0.000s · 68MB
66MB installed
● package 66MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

settings_export
from django_settings_export import settings_export
from SETTINGS_EXPORT.settings_export import settings_export

Add 'SETTINGS_EXPORT' to INSTALLED_APPS, add the context processor, and define SETTINGS_EXPORT list.

# settings.py INSTALLED_APPS = [ ... 'SETTINGS_EXPORT', ] TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'OPTIONS': { 'context_processors': [ ... 'SETTINGS_EXPORT.settings_export.settings_export', ], }, }, ] SETTINGS_EXPORT = [ 'DEBUG', 'SITE_NAME', ] # In template: # {{ settings.DEBUG }}
Debug
Known issues
gotchaThe app name in INSTALLED_APPS and context processor path is 'SETTINGS_EXPORT' (all caps). Many people mistakenly use 'settings_export' or 'django_settings_export'.
fix
Use exactly 'SETTINGS_EXPORT' (uppercase).
affects: all
gotchaThe context processor adds all settings from SETTINGS_EXPORT list to the template context under a variable named 'settings' (or custom name via SETTINGS_EXPORT_VARIABLE_NAME). This may conflict with other context processors that also add a 'settings' variable.
fix
Use SETTINGS_EXPORT_VARIABLE_NAME to set a unique variable name (e.g., 'my_settings').
affects: all
Upgrade
Version history
1.2.1latest on PyPI · released Nov 6, 2016
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
14
Resources
django-settings-export — pip install django-settings-export · libregistry