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.

42 lines
1.5 KiB

  1. """
  2. Local settings for the HealthChecks app
  3. """
  4. import os
  5. ALLOWED_HOSTS = ['*']
  6. DEBUG = os.getenv('HEALTHCHECKS_DEBUG', False)
  7. HOST = os.getenv('HEALTHCHECKS_HOST', "localhost")
  8. SITE_ROOT = os.getenv('HEALTHCHECKS_SITE_ROOT', "http://localhost:9090")
  9. PING_ENDPOINT = SITE_ROOT + "/ping/"
  10. DEFAULT_FROM_EMAIL = os.getenv('HEALTHCHECKS_EMAIL_FROM', "[email protected]")
  11. EMAIL_HOST = os.getenv('HEALTHCHECKS_EMAIL_HOST', "localhost")
  12. EMAIL_PORT = os.getenv('HEALTHCHECKS_EMAIL_PORT', 25)
  13. EMAIL_HOST_USER = os.getenv('HEALTHCHECKS_EMAIL_USER', "")
  14. EMAIL_HOST_PASSWORD = os.getenv('HEALTHCHECKS_EMAIL_PASSWORD', "")
  15. if os.environ.get("HEALTHCHECKS_DB") == "postgres":
  16. DATABASES = {
  17. 'default': {
  18. 'ENGINE': 'django.db.backends.postgresql',
  19. 'NAME': os.getenv("HEALTHCHECKS_DB_NAME", "hc"),
  20. 'USER': os.getenv('HEALTHCHECKS_DB_USER', "postgres"),
  21. 'PASSWORD': os.getenv('HEALTHCHECKS_DB_PASSWORD', ""),
  22. 'HOST': os.getenv('HEALTHCHECKS_DB_HOST', "localhost"),
  23. 'TEST': {'CHARSET': 'UTF8'}
  24. }
  25. }
  26. if os.environ.get("HEALTHCHECKS_DB") == "mysql":
  27. DATABASES = {
  28. 'default': {
  29. 'ENGINE': 'django.db.backends.mysql',
  30. 'USER': os.getenv('HEALTHCHECKS_DB_USER', "root"),
  31. 'PASSWORD': os.getenv('HEALTHCHECKS_DB_PASSWORD', ""),
  32. 'NAME': os.getenv("HEALTHCHECKS_DB_NAME", "hc"),
  33. 'HOST': os.getenv('HEALTHCHECKS_DB_HOST', "localhost"),
  34. 'TEST': {'CHARSET': 'UTF8'}
  35. }
  36. }