Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Configurable Javascript settings in Django.

Project Description

Configurable JavaScript settings in Django


Add 'settingsjs' to your INSTALLED_APPS (for the templates)
Include 'settingsjs.urls' in your urls.
Add a script tag with src="{% url settings_js %}"
<script type="text/javascript" src="{% url settings_js %}"></script>

Access the settings in JavaScript using Setting.get and Setting.get:

<script type="text/javascript">
var myapp_settings = Setting.get('myapp-settings');

Setting.set('some_key', 'some value');

Setting JavaScript settings

Use the SETTINGS_JS setting to specify settings:

'myapp-settings': {
"fu": "bar",

Use settingsjs.signals.collect_settings:

e.g. In a file that will always be loaded (such as a models or urls file).

from settingsjs.signals import collect_settings
from django.dispatch import receiver

def videos_settingsjs(sender, jssettings=None, **kwargs):
if jssettings is not None:
jssettings['myapp-settings'] = {
"fu": "bar",

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(2.1 kB) Copy SHA256 Hash SHA256
Source None Jan 24, 2014

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers