settings.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. from pathlib import Path
  2. import environ
  3. env = environ.Env(DEBUG=(bool, False))
  4. environ.Env.read_env()
  5. SECRET_KEY = env("SECRET_KEY")
  6. DEBUG = env("DEBUG")
  7. DATABASES = {'default': env.db('SQLITE_URL')}
  8. BASE_DIR = Path(__file__).resolve().parent.parent
  9. ALLOWED_HOSTS = []
  10. INSTALLED_APPS = [
  11. 'django.contrib.admin',
  12. 'django.contrib.auth',
  13. 'django.contrib.contenttypes',
  14. 'django.contrib.sessions',
  15. 'django.contrib.messages',
  16. 'django.contrib.staticfiles',
  17. # 3rd party
  18. 'rest_framework',
  19. # local
  20. 'appupload.apps.AppuploadConfig',
  21. ]
  22. MIDDLEWARE = [
  23. 'django.middleware.security.SecurityMiddleware',
  24. 'django.contrib.sessions.middleware.SessionMiddleware',
  25. 'django.middleware.common.CommonMiddleware',
  26. 'django.middleware.csrf.CsrfViewMiddleware',
  27. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  28. 'django.contrib.messages.middleware.MessageMiddleware',
  29. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  30. ]
  31. ROOT_URLCONF = 'core.urls'
  32. TEMPLATES = [
  33. {
  34. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  35. 'DIRS': [],
  36. 'APP_DIRS': True,
  37. 'OPTIONS': {
  38. 'context_processors': [
  39. 'django.template.context_processors.debug',
  40. 'django.template.context_processors.request',
  41. 'django.contrib.auth.context_processors.auth',
  42. 'django.contrib.messages.context_processors.messages',
  43. ],
  44. },
  45. },
  46. ]
  47. WSGI_APPLICATION = 'core.wsgi.application'
  48. AUTH_PASSWORD_VALIDATORS = [
  49. {'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', },
  50. {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', },
  51. {'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', },
  52. {'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', },
  53. ]
  54. LANGUAGE_CODE = 'en-us'
  55. TIME_ZONE = 'UTC'
  56. USE_I18N = True
  57. USE_L10N = True
  58. USE_TZ = True
  59. STATIC_URL = '/static/'