==========================================
INSTALATION
===========
Add 'settingsjs' to your INSTALLED_APPS (for the templates)
Include 'settingsjs.urls' in your urls.
Add a script tag with src="{% url settings_js %}"
e.g.
<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');
</script>
Setting JavaScript settings
===========================
Use the SETTINGS_JS setting to specify settings:
e.g.
SETTINGS_JS = {
'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
@receiver(collect_settings)
def videos_settingsjs(sender, jssettings=None, **kwargs):
if jssettings is not None:
jssettings['myapp-settings'] = {
"fu": "bar",
}
Metadata
Release files for django-settingsjs 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-settingsjs-0.1.5.tar.gz | 2.1 kB | Without provenance | Details for django-settingsjs-0.1.5.tar.gz |
Release files / django-settingsjs-0.1.5.tar.gz
| Download URL | django-settingsjs-0.1.5.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
687faeff10ea8484a79eff1c097e346df23152e5ac5f322ae17771b7d0a0c5f2
|
|
BLAKE2b-256 checksum How to use checksums |
91d8b66feff9325c5c65e3c16cdce1d58179c0dbc35ed520407366c3ccca6e57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-settingsjs 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.