Django Library Users
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

parameter.py 604B

1234567891011121314151617181920212223242526
  1. import config
  2. from django.conf import settings
  3. USERS_SELF_REGISTRATION = "USERS_SELF_REGISTRATION"
  4. # USERS_MAIL_VALIDATION = "USERS_MAIL_VALIDATION"
  5. # USERS_MAIL_INFORMATION = "USERS_MAIL_INFORMATION"
  6. DEFAULTS = {
  7. USERS_SELF_REGISTRATION: False,
  8. # USERS_MAIL_VALIDATION: True,
  9. # USERS_MAIL_INFORMATION: True,
  10. }
  11. def get(key):
  12. # take data from config, settings or defaults
  13. try:
  14. data = getattr(config, key)
  15. except AttributeError:
  16. try:
  17. data = getattr(settings, key)
  18. except AttributeError:
  19. data = DEFAULTS.get(key)
  20. return data