import config from django.conf import settings USERS_SELF_REGISTRATION = "USERS_SELF_REGISTRATION" # TODO: Implement or find the mail validation and the methods to ask for the user status # USERS_MAIL_VALIDATION = "USERS_MAIL_VALIDATION" # TODO: Implement or mail information (Admins: New Useraccounts, Failed logins; User: Password Change, ...) # USERS_MAIL_INFORMATION = "USERS_MAIL_INFORMATION" DEFAULTS = { # TODO: Implement the parameer functionality USERS_SELF_REGISTRATION USERS_SELF_REGISTRATION: False, # USERS_MAIL_VALIDATION: True, # USERS_MAIL_INFORMATION: True, } def get(key): # take data from config, settings or defaults try: data = getattr(config, key) except AttributeError: try: data = getattr(settings, key) except AttributeError: data = DEFAULTS.get(key) return data