2
0

common.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. """
  2. Django settings for abs project.
  3. Generated by 'django-admin startproject' using Django 2.0.4.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/2.0/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/2.0/ref/settings/
  8. """
  9. import os
  10. import platform
  11. VERSION = '3.0.1'
  12. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  13. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  14. # Quick-start development settings - unsuitable for production
  15. # See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
  16. # SECURITY WARNING: keep the secret key used in production secret!
  17. SECRET_KEY = 'm$*&&u*9+-$g^b9lj0)**1$0$wfh1wk$ye^4p+s)cera)g3fml'
  18. # SECURITY WARNING: don't run with debug turned on in production!
  19. DEBUG = True
  20. ALLOWED_HOSTS = []
  21. # Application definition
  22. INSTALLED_APPS = [
  23. # 'django.contrib.admin',
  24. 'django.contrib.auth',
  25. 'django.contrib.contenttypes',
  26. 'django.contrib.sessions',
  27. 'django.contrib.messages',
  28. 'django.contrib.staticfiles',
  29. 'apps.account',
  30. 'apps.ticket',
  31. 'apps.workflow',
  32. 'apps.util',
  33. 'apps.manage'
  34. ]
  35. ROOT_URLCONF = 'loonflow.urls'
  36. TEMPLATES = [
  37. {
  38. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  39. 'DIRS': [os.path.join(BASE_DIR, 'templates')],
  40. 'APP_DIRS': True,
  41. 'OPTIONS': {
  42. 'context_processors': [
  43. 'django.template.context_processors.debug',
  44. 'django.template.context_processors.request',
  45. 'django.contrib.auth.context_processors.auth',
  46. 'django.contrib.messages.context_processors.messages',
  47. 'loonflow.contexts.global_variables',
  48. ],
  49. 'libraries':{
  50. 'loonflow_filter': 'apps.manage.templatetags.loonflow_filter',
  51. }
  52. },
  53. },
  54. ]
  55. WSGI_APPLICATION = 'loonflow.wsgi.application'
  56. AUTH_PASSWORD_VALIDATORS = [
  57. {
  58. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  59. },
  60. {
  61. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  62. },
  63. {
  64. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  65. },
  66. {
  67. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  68. },
  69. ]
  70. LANGUAGE_CODE = 'zh-hans'
  71. TIME_ZONE = 'Asia/Shanghai'
  72. USE_I18N = True
  73. USE_L10N = True
  74. USE_TZ = True
  75. DATETIME_FORMAT = 'Y-m-d H:i:s'
  76. TIME_FORMAT = 'H:i:s'
  77. LOGIN_URL = '/account/login/'
  78. AUTH_USER_MODEL = 'account.User'
  79. AUTHENTICATION_BACKENDS = ['service.account.account_auth_service.EmailBackend']
  80. STATIC_URL = '/static/'
  81. FIXTURE_DIRS = ['fixtures/']
  82. STATIC_FILES_VERSION = '1.0'
  83. LOGIN_URL = '/manage/login'
  84. APPEND_SLASH = False # disable urls.W002 warning
  85. if platform.system() == 'Windows':
  86. HOMEPATH = os.environ['HOMEPATH']
  87. else:
  88. HOMEPATH = os.environ['HOME']
  89. JWT_SALT = 'aUApFqfQjyYVAPo8'
  90. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'