Created
January 24, 2015 16:29
-
-
Save benma/1d871e7c0ae1a17e09ae to your computer and use it in GitHub Desktop.
external settings verifier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .... | |
# in settings.py (oder sonst eine versionierte datei) | |
import settings_sensitive | |
class ImproperlyConfigured(Exception): | |
pass | |
try: | |
GIBT_ES = settings_sensitive.GIBT_ES | |
GIBT_ES_NICHT = settings_sensitive.GIBT_ES_NICHT | |
except AttributeError, e: | |
raise ImproperlyConfigured("Missing config variable: %s" % e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GIBT_ES = "huhu" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment