diff --git a/bmon/settings_example.py b/bmon/settings_example.py index b59beb3a2df67a3812d1689883045b25ce47b442..bf316e1721334fc4cf61792eb4ab341da4cba486 100644 --- a/bmon/settings_example.py +++ b/bmon/settings_example.py @@ -155,19 +155,3 @@ from .settings_common import * # ----- If you need to override any of the settings in the 'settings_common.py' file # ----- do so below this point in this file. - - -# ----- Settings for Lockdown - -#INSTALLED_APPS += ('lockdown', ) -#MIDDLEWARE += ('lockdown.middleware.LockdownMiddleware',) -#LOCKDOWN_FORM = 'lockdown.forms.AuthForm' -#LOCKDOWN_AUTHFORM_STAFF_ONLY = False - -#LOCKDOWN_URL_EXCEPTIONS = ( r'^/readingdb/reading/(\w+)/store/$', # URL to store one reading into database -# r'^/readingdb/reading/store/$', # URL to store multiple readings into database -# r'^/readingdb/reading/store-things/$', # URL to store readings from Things Network -# r'^/readingdb/reading/store-rb/$', # Store Rb -# r'^st8(\w+)/', # Old URL pattern for storing -# r'^/readingdb/reading/(\w+)/$', # gets all readings for one reading ID -# ) diff --git a/bmon/settings_lockdown.py b/bmon/settings_lockdown.py new file mode 100644 index 0000000000000000000000000000000000000000..78f04fda58f5b8ead56482a2ffabb6b9cb0f1bfd --- /dev/null +++ b/bmon/settings_lockdown.py @@ -0,0 +1,29 @@ +# ----- Settings for Lockdown +# To use the Lockdown feature, include the following line at the end of the +# 'settings.py' file (without the beginning # character): +# from .settings_lockdown import * + +from .settings_common import INSTALLED_APPS, MIDDLEWARE + +INSTALLED_APPS += ('lockdown', ) +MIDDLEWARE += ('lockdown.middleware.LockdownMiddleware',) + +# Has the log-in form accept the standar User credentials for determining +# who has access +LOCKDOWN_FORM = 'lockdown.forms.AuthForm' + +# Allows users who do not have Staff privileges (ability to add Sensors, Buildings, +# etc.) to view the site if this setting is set to False. +LOCKDOWN_AUTHFORM_STAFF_ONLY = False + +# An alternative authorization method: user only has to enter one of +# passwords in the following tuple. To use this, uncomment line below and +# comment out the "LOCKDOWN_FORM" line. +# LOCKDOWN_PASSWORDS = ('letmein', 'beta') + +LOCKDOWN_URL_EXCEPTIONS = ( r'^/readingdb/reading/(\w+)/store/$', # URL to store one reading into database + r'^/readingdb/reading/store/$', # URL to store multiple readings into database + r'^/readingdb/reading/store-things/$', # URL to store readings from Things Network + r'^/readingdb/reading/store-rb/$', # Store Radio Bridge sensors + r'^st8(\w+)/', # Old URL pattern for storing + )