|
| 1 | +""" |
| 2 | +Django settings for mysql project. |
| 3 | +
|
| 4 | +Generated by 'django-admin startproject' using Django 3.1.5. |
| 5 | +
|
| 6 | +For more information on this file, see |
| 7 | +https://docs.djangoproject.com/en/3.1/topics/settings/ |
| 8 | +
|
| 9 | +For the full list of settings and their values, see |
| 10 | +https://docs.djangoproject.com/en/3.1/ref/settings/ |
| 11 | +""" |
| 12 | + |
| 13 | +# stuff for heroku |
| 14 | +import django_heroku |
| 15 | +from decouple import Config |
| 16 | +from pathlib import Path |
| 17 | + |
| 18 | +# Build paths inside the project like this: BASE_DIR / 'subdir'. |
| 19 | +BASE_DIR = Path(__file__).resolve().parent.parent |
| 20 | + |
| 21 | + |
| 22 | +# Quick-start development settings - unsuitable for production |
| 23 | +# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ |
| 24 | + |
| 25 | +# SECURITY WARNING: keep the secret key used in production secret! |
| 26 | +# Import Secret Keys |
| 27 | +SECRET_KEY = Config('SECRET_KEY') |
| 28 | + |
| 29 | +# SECURITY WARNING: don't run with debug turned on in production! |
| 30 | +DEBUG = True |
| 31 | + |
| 32 | +ALLOWED_HOSTS = [] |
| 33 | + |
| 34 | + |
| 35 | +# Application definition |
| 36 | + |
| 37 | +INSTALLED_APPS = [ |
| 38 | + 'django.contrib.admin', |
| 39 | + 'django.contrib.auth', |
| 40 | + 'django.contrib.contenttypes', |
| 41 | + 'django.contrib.sessions', |
| 42 | + 'django.contrib.messages', |
| 43 | + 'django.contrib.staticfiles', |
| 44 | + 'django_extensions', |
| 45 | + 'werkzeug', |
| 46 | + 'import_export', |
| 47 | + 'rest_framework', |
| 48 | +] |
| 49 | + |
| 50 | +MIDDLEWARE = [ |
| 51 | + 'django.middleware.security.SecurityMiddleware', |
| 52 | + 'whitenoise.middleware.WhiteNoiseMiddleware', |
| 53 | + 'django.contrib.sessions.middleware.SessionMiddleware', |
| 54 | + 'django.middleware.common.CommonMiddleware', |
| 55 | + 'django.middleware.csrf.CsrfViewMiddleware', |
| 56 | + 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 57 | + 'django.contrib.messages.middleware.MessageMiddleware', |
| 58 | + 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 59 | +] |
| 60 | + |
| 61 | +ROOT_URLCONF = 'mysql.urls' |
| 62 | + |
| 63 | +TEMPLATES = [ |
| 64 | + { |
| 65 | + 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
| 66 | + 'DIRS': [], |
| 67 | + 'APP_DIRS': True, |
| 68 | + 'OPTIONS': { |
| 69 | + 'context_processors': [ |
| 70 | + 'django.template.context_processors.debug', |
| 71 | + 'django.template.context_processors.request', |
| 72 | + 'django.contrib.auth.context_processors.auth', |
| 73 | + 'django.contrib.messages.context_processors.messages', |
| 74 | + ], |
| 75 | + }, |
| 76 | + }, |
| 77 | +] |
| 78 | + |
| 79 | +WSGI_APPLICATION = 'mysql.wsgi.application' |
| 80 | + |
| 81 | + |
| 82 | +# Database |
| 83 | +# https://docs.djangoproject.com/en/3.1/ref/settings/#databases |
| 84 | + |
| 85 | +DATABASES = { |
| 86 | + 'default': { |
| 87 | + 'ENGINE': 'django.db.backends.sqlite3', |
| 88 | + 'NAME': BASE_DIR / 'db.sqlite3', |
| 89 | + } |
| 90 | +} |
| 91 | + |
| 92 | + |
| 93 | +# Password validation |
| 94 | +# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators |
| 95 | + |
| 96 | +AUTH_PASSWORD_VALIDATORS = [ |
| 97 | + { |
| 98 | + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
| 99 | + }, |
| 100 | + { |
| 101 | + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
| 102 | + }, |
| 103 | + { |
| 104 | + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
| 105 | + }, |
| 106 | + { |
| 107 | + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
| 108 | + }, |
| 109 | +] |
| 110 | + |
| 111 | + |
| 112 | +# Internationalization |
| 113 | +# https://docs.djangoproject.com/en/3.1/topics/i18n/ |
| 114 | + |
| 115 | +LANGUAGE_CODE = 'en-us' |
| 116 | + |
| 117 | +TIME_ZONE = 'UTC' |
| 118 | + |
| 119 | +USE_I18N = True |
| 120 | + |
| 121 | +USE_L10N = True |
| 122 | + |
| 123 | +USE_TZ = True |
| 124 | + |
| 125 | +STATIC_ROOT = BASE_DIR / 'static' |
| 126 | +STATIC_URL = '/static/' |
| 127 | +STATICFILES_DIRS = [ |
| 128 | +] |
| 129 | + |
| 130 | +STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' |
0 commit comments