Skip to content

Change Django Settings On the Fly

License

Notifications You must be signed in to change notification settings

jayvdb/onthefly

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

onthefly

Change Django Settings on Custom admin page at "RUNTIME".

Installation

pip install django-onthefly

Configuration

adminplus configuration (INSTALLED_APPS)

Replace 'django.contrib.admin' with 'django.contrib.admin.apps.SimpleAdminConfig' Add 'adminplus' after SimpleAdminConfig

'django.contrib.admin.apps.SimpleAdminConfig',
# ...
'adminplus',
# ...
onthefly configuration (INSTALLED_APPS)

Add 'onthefly' at the bottom of the list.

Final INSTALLED_APPS
INSTALLED_APPS = (
    'django.contrib.admin.apps.SimpleAdminConfig', (instead of 'django.contrib.admin')
    # ...
    'adminplus',
    # ...
    # ...
    'onthefly'
    )
You need to change urls.py like below as well
    # urls.py
    from django.contrib import admin
    from adminplus.sites import AdminSitePlus

    admin.site = AdminSitePlus()
    admin.autodiscover()

    urlpatterns = [
        # ...
        # Include the admin URL conf as normal.
        (r'^admin', include(admin.site.urls)),
        # ...
    ]

Usage

go to django admin panel and see Onthefly Settings on bottom of the page as Custom Views Add, Delete or Change settings at runtime.

TODOs

1- Add new backends apart from Redis
2- Exception fallback to prevent unstabilities while changing settings at runtime
3- More if you 'd like to contribute!

CONTRIBUTE

All contributions are very welcomed!

SCREENSHOT

ScreenShot

About

Change Django Settings On the Fly

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 68.0%
  • HTML 32.0%