settings.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. """
  2. Django settings for DjangoWebProject1 project.
  3. Generated by 'django-admin startproject' using Django 1.9.1.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/1.9/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/1.9/ref/settings/
  8. """
  9. import os
  10. import posixpath
  11. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  12. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  13. # Quick-start development settings - unsuitable for production
  14. # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
  15. # SECURITY WARNING: keep the secret key used in production secret!
  16. SECRET_KEY = 'b82f6c80-2fb7-45b5-bf07-f8a58fa3782d'
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = True
  19. ALLOWED_HOSTS = []
  20. # Application definition
  21. INSTALLED_APPS = [
  22. 'app',
  23. # Add your apps here to enable them
  24. 'django.contrib.admin',
  25. 'django.contrib.auth',
  26. 'django.contrib.contenttypes',
  27. 'django.contrib.sessions',
  28. 'django.contrib.messages',
  29. 'django.contrib.staticfiles',
  30. ]
  31. MIDDLEWARE_CLASSES = [
  32. 'django.middleware.security.SecurityMiddleware',
  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 = 'DjangoWebProject1.urls'
  42. TEMPLATES = [
  43. {
  44. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  45. 'DIRS': [],
  46. 'APP_DIRS': True,
  47. 'OPTIONS': {
  48. 'context_processors': [
  49. 'django.template.context_processors.debug',
  50. 'django.template.context_processors.request',
  51. 'django.contrib.auth.context_processors.auth',
  52. 'django.contrib.messages.context_processors.messages',
  53. ],
  54. },
  55. },
  56. ]
  57. WSGI_APPLICATION = 'DjangoWebProject1.wsgi.application'
  58. # Database
  59. # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
  60. DATABASES = {
  61. 'default': {
  62. 'ENGINE': 'django.db.backends.sqlite3',
  63. 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  64. }
  65. }
  66. # Password validation
  67. # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
  68. AUTH_PASSWORD_VALIDATORS = [
  69. {
  70. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  71. },
  72. {
  73. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  74. },
  75. {
  76. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  77. },
  78. {
  79. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  80. },
  81. ]
  82. # Internationalization
  83. # https://docs.djangoproject.com/en/1.9/topics/i18n/
  84. LANGUAGE_CODE = 'en-us'
  85. TIME_ZONE = 'UTC'
  86. USE_I18N = True
  87. USE_L10N = True
  88. USE_TZ = True
  89. # Static files (CSS, JavaScript, Images)
  90. # https://docs.djangoproject.com/en/1.9/howto/static-files/
  91. STATIC_URL = '/static/'
  92. STATIC_ROOT = posixpath.join(*(BASE_DIR.split(os.path.sep) + ['static']))