2
0

common.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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 = '2.0.18'
  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. ]
  33. ROOT_URLCONF = 'loonflow.urls'
  34. TEMPLATES = [
  35. {
  36. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  37. 'DIRS': [os.path.join(BASE_DIR, 'templates')],
  38. 'APP_DIRS': True,
  39. 'OPTIONS': {
  40. 'context_processors': [
  41. 'django.template.context_processors.debug',
  42. 'django.template.context_processors.request',
  43. 'django.contrib.auth.context_processors.auth',
  44. 'django.contrib.messages.context_processors.messages',
  45. 'loonflow.contexts.global_variables',
  46. ],
  47. 'libraries':{
  48. 'loonflow_filter': 'apps.manage.templatetags.loonflow_filter',
  49. }
  50. },
  51. },
  52. ]
  53. WSGI_APPLICATION = 'loonflow.wsgi.application'
  54. AUTH_PASSWORD_VALIDATORS = [
  55. {
  56. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  57. },
  58. {
  59. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  60. },
  61. {
  62. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  63. },
  64. {
  65. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  66. },
  67. ]
  68. LANGUAGE_CODE = 'zh-hans'
  69. TIME_ZONE = 'Asia/Shanghai'
  70. USE_I18N = True
  71. USE_L10N = False
  72. USE_TZ = False
  73. DATETIME_FORMAT = 'Y-m-d H:i:s'
  74. TIME_FORMAT = 'H:i:s'
  75. LOGIN_URL = '/account/login/'
  76. AUTH_USER_MODEL = 'account.LoonUser'
  77. STATIC_URL = '/static/'
  78. FIXTURE_DIRS = ['fixtures/']
  79. STATIC_FILES_VERSION = '1.0'
  80. LOGIN_URL = '/manage/login'
  81. APPEND_SLASH = False # disable urls.W002 warning
  82. if platform.system() == 'Windows':
  83. HOMEPATH = os.environ['HOMEPATH']
  84. else:
  85. HOMEPATH = os.environ['HOME']
  86. JWT_SALT = 'aUApFqfQjyYVAPo8'
  87. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'