settings.py 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. """
  2. Django settings for desecapi project.
  3. For more information on this file, see
  4. https://docs.djangoproject.com/en/1.7/topics/settings/
  5. For the full list of settings and their values, see
  6. https://docs.djangoproject.com/en/1.7/ref/settings/
  7. """
  8. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  9. import os
  10. BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  11. # Quick-start development settings - unsuitable for production
  12. # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
  13. # SECURITY WARNING: keep the secret key used in production secret!
  14. SECRET_KEY = 'lk*42u45uy9dg8l+o9$x56&%_@+85u+20#m82+f8r#w_*cj483'
  15. # SECURITY WARNING: don't run with debug turned on in production!
  16. DEBUG = False
  17. TEMPLATE_DEBUG = True
  18. ALLOWED_HOSTS = []
  19. # Application definition
  20. INSTALLED_APPS = (
  21. 'django.contrib.admin',
  22. 'django.contrib.auth',
  23. 'django.contrib.contenttypes',
  24. 'django.contrib.sessions',
  25. 'django.contrib.messages',
  26. 'django.contrib.staticfiles',
  27. 'rest_framework',
  28. 'rest_framework.authtoken',
  29. 'djoser',
  30. 'desecapi',
  31. )
  32. MIDDLEWARE_CLASSES = (
  33. 'django.contrib.sessions.middleware.SessionMiddleware',
  34. 'django.middleware.common.CommonMiddleware',
  35. 'django.middleware.csrf.CsrfViewMiddleware',
  36. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  37. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  38. 'django.contrib.messages.middleware.MessageMiddleware',
  39. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  40. )
  41. ROOT_URLCONF = 'desecapi.urls'
  42. WSGI_APPLICATION = 'desecapi.wsgi.application'
  43. # Database
  44. # https://docs.djangoproject.com/en/1.7/ref/settings/#databases
  45. DATABASES = {
  46. 'default': {
  47. # 'ENGINE': 'django.db.backends.sqlite3',
  48. # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  49. 'ENGINE': 'django.db.backends.mysql',
  50. 'NAME': '',
  51. 'USER': '',
  52. 'PASSWORD': '',
  53. 'HOST': '127.0.0.1',
  54. 'CHARSET': 'utf8',
  55. 'COLLATION': 'utf8_general_ci',
  56. 'TEST': {
  57. 'CHARSET': 'utf8',
  58. 'COLLATION': 'utf8_general_ci',
  59. }
  60. },
  61. }
  62. # Internationalization
  63. # https://docs.djangoproject.com/en/1.7/topics/i18n/
  64. LANGUAGE_CODE = 'en-us'
  65. TIME_ZONE = 'UTC'
  66. USE_I18N = True
  67. USE_L10N = True
  68. USE_TZ = True
  69. # Static files (CSS, JavaScript, Images)
  70. # https://docs.djangoproject.com/en/1.7/howto/static-files/
  71. STATIC_URL = '/api/static/'
  72. REST_FRAMEWORK = {
  73. 'DEFAULT_AUTHENTICATION_CLASSES': (
  74. 'rest_framework.authentication.TokenAuthentication',
  75. ),
  76. }
  77. # user management configuration
  78. DJOSER = {
  79. 'DOMAIN': 'desec.io',
  80. 'SITE_NAME': 'deSEC',
  81. 'PASSWORD_RESET_CONFIRM_URL': '#/password/reset/confirm/{uid}/{token}',
  82. 'ACTIVATION_URL': '#/activate/{uid}/{token}',
  83. 'LOGIN_AFTER_ACTIVATION': True,
  84. 'SEND_ACTIVATION_EMAIL': False,
  85. }
  86. # How to send mail
  87. EMAIL_HOST = ''
  88. EMAIL_HOST_USER = ''
  89. EMAIL_HOST_PASSWORD = ''
  90. EMAIL_PORT = ''
  91. DEFAULT_FROM_EMAIL = 'deSEC.io <support@desec.io>'
  92. # use our own user model
  93. AUTH_USER_MODEL = 'desecapi.User'
  94. # Import local settings
  95. try:
  96. from settings_local import *
  97. except ImportError, exp:
  98. pass