Django Singleton Admin
In dynamic applications, it can be somewhat of a pain to have static settings that have to be set in settings.py. Django Singleton Admin adds an easy way to edit singleton models (e.g a SiteSetting model) to allow administrators to change configuration on the fly.
This is great for things like OAuth settings for third parties, or dynamic settings that you need to pull for your site.
Installation
- Install with Pip
pip install django-singleton-admin-2 - Add
django_singleton_admintoINSTALLED_APPS
Influenced By
Example
# models.py
from django.db import models
class SiteSettings(models.Model):
site_title = models.CharField(max_length=32)
site_domain = models.CharField(max_length=32)
site_description = models.CharField(max_length=32)
@staticmethod
def get_instance():
return SiteSettings.objects.get_or_create(pk=0)
def __str__(self):
return "Site settings"
# admin.py
from django.contrib import admin
from .models import SiteSettings
from django_singleton_admin.admin import DjangoSingletonModelAdmin
admin.site.register(SiteSettings, DjangoSingletonModelAdmin)
Metadata
Release files for django-singleton-admin-2 1.1.0
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-singleton-admin-2-1.1.0.tar.gz | 4.0 kB | Without provenance | Details for django-singleton-admin-2-1.1.0.tar.gz |
Release files / django-singleton-admin-2-1.1.0.tar.gz
| Download URL | django-singleton-admin-2-1.1.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
366753fe5660a4adbd142658bc62eeabfd3e6886d3322e94e8e067a1b3b0a814
|
|
BLAKE2b-256 checksum How to use checksums |
bd092418b8c496140231ec75efa3746f57ac246f0646ee8fd5e86ca5bc6c27f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9
|
Security for django-singleton-admin-2 1.1.0
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.