Django Library Users
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

parameter.py 874B

1234567891011121314151617181920212223242526272829
  1. import config
  2. from django.conf import settings
  3. USERS_SELF_REGISTRATION = "USERS_SELF_REGISTRATION"
  4. # TODO: Implement or find the mail validation and the methods to ask for the user status
  5. # USERS_MAIL_VALIDATION = "USERS_MAIL_VALIDATION"
  6. # TODO: Implement or mail information (Admins: New Useraccounts, Failed logins; User: Password Change, ...)
  7. # USERS_MAIL_INFORMATION = "USERS_MAIL_INFORMATION"
  8. DEFAULTS = {
  9. # TODO: Implement the parameer functionality USERS_SELF_REGISTRATION
  10. USERS_SELF_REGISTRATION: False,
  11. # USERS_MAIL_VALIDATION: True,
  12. # USERS_MAIL_INFORMATION: True,
  13. }
  14. def get(key):
  15. # take data from config, settings or defaults
  16. try:
  17. data = getattr(config, key)
  18. except AttributeError:
  19. try:
  20. data = getattr(settings, key)
  21. except AttributeError:
  22. data = DEFAULTS.get(key)
  23. return data