]>
git.p6c8.net - pcdenotes.git/blob - pcdenotes/settings.py
2 Django settings for pcdenotes project.
4 Generated by 'django-admin startproject' using Django 3.2.11.
6 For more information on this file, see
7 https://docs.djangoproject.com/en/3.2/topics/settings/
9 For the full list of settings and their values, see
10 https://docs.djangoproject.com/en/3.2/ref/settings/
13 from pathlib
import Path
15 from dotenv
import load_dotenv
, find_dotenv
19 # Build paths inside the project like this: BASE_DIR / 'subdir'.
20 BASE_DIR
= Path(__file__
).resolve().parent
.parent
23 load_dotenv(BASE_DIR
/ '.env')
25 # Quick-start development settings - unsuitable for production
26 # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
28 # SECURITY WARNING: keep the secret key used in production secret!
29 SECRET_KEY
= str(os
.getenv('PCDENOTES_SECRET_KEY'))
31 # SECURITY WARNING: don't run with debug turned on in production!
32 DEBUG
= str(os
.getenv('PCDENOTES_DEBUG', 'false')).lower() == 'true'
37 # Application definition
40 'django.contrib.admin',
41 'django.contrib.auth',
42 'django.contrib.contenttypes',
43 'django.contrib.sessions',
44 'django.contrib.messages',
45 'django.contrib.staticfiles',
46 'markdownify.apps.MarkdownifyConfig',
51 'django.middleware.security.SecurityMiddleware',
52 'django.contrib.sessions.middleware.SessionMiddleware',
53 'django.middleware.common.CommonMiddleware',
54 'django.middleware.csrf.CsrfViewMiddleware',
55 'django.contrib.auth.middleware.AuthenticationMiddleware',
56 'django.contrib.messages.middleware.MessageMiddleware',
57 'django.middleware.clickjacking.XFrameOptionsMiddleware',
60 ROOT_URLCONF
= 'pcdenotes.urls'
64 'BACKEND': 'django.template.backends.django.DjangoTemplates',
68 'context_processors': [
69 'django.template.context_processors.debug',
70 'django.template.context_processors.request',
71 'django.contrib.auth.context_processors.auth',
72 'django.contrib.messages.context_processors.messages',
78 WSGI_APPLICATION
= 'pcdenotes.wsgi.application'
82 # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
86 'ENGINE': 'django.db.backends.mysql',
87 'NAME': str(os
.getenv('PCDENOTES_DB_NAME')),
88 'HOST': str(os
.getenv('PCDENOTES_DB_HOST')),
89 'PORT': int(os
.getenv('PCDENOTES_DB_PORT')),
90 'USER': str(os
.getenv('PCDENOTES_DB_USER')),
91 'PASSWORD': str(os
.getenv('PCDENOTES_DB_PASSWORD'))
97 # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
99 AUTH_PASSWORD_VALIDATORS
= [
101 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
104 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
107 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
110 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
115 # Internationalization
116 # https://docs.djangoproject.com/en/3.2/topics/i18n/
118 LANGUAGE_CODE
= 'en-us'
129 # Static files (CSS, JavaScript, Images)
130 # https://docs.djangoproject.com/en/3.2/howto/static-files/
132 STATIC_URL
= '/static/'
133 STATIC_ROOT
= BASE_DIR
/ 'static'
135 # Default primary key field type
136 # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
138 DEFAULT_AUTO_FIELD
= 'django.db.models.BigAutoField'
patrick-canterino.de