Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add get_setting_or_die utility

  • Loading branch information...
commit a59267b09d8cc5c0a87caa5396ff1ac4dc4ebd35 1 parent 7b83dcf
@idan authored
View
0  telostats/utils/__init__.py
No changes.
View
9 telostats/utils/settings.py
@@ -0,0 +1,9 @@
+from django.conf import settings
+from django.core.exceptions import ImproperlyConfigured
+
+
+def get_setting_or_die(setting):
+ try:
+ return getattr(settings, setting)
+ except AttributeError:
+ raise ImproperlyConfigured('No setting named "{0}" was found in settings.py.'.format(setting))
Please sign in to comment.
Something went wrong with that request. Please try again.