]>
git.p6c8.net - pcdenotes.git/blob - pcdenotes/settings.py
6225f2fe121f5778b3844bd6848fed5efb8d5d44
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',
48 'notes.templatetags.notes_extras'
52 'django.middleware.security.SecurityMiddleware',
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',
61 ROOT_URLCONF
= 'pcdenotes.urls'
65 'BACKEND': 'django.template.backends.django.DjangoTemplates',
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',
79 WSGI_APPLICATION
= 'pcdenotes.wsgi.application'
83 # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
87 'ENGINE': 'django.db.backends.mysql',
88 'NAME': str(os
.getenv('PCDENOTES_DB_NAME')),
89 'HOST': str(os
.getenv('PCDENOTES_DB_HOST')),
90 'PORT': int(os
.getenv('PCDENOTES_DB_PORT')),
91 'USER': str(os
.getenv('PCDENOTES_DB_USER')),
92 'PASSWORD': str(os
.getenv('PCDENOTES_DB_PASSWORD'))
98 # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
100 AUTH_PASSWORD_VALIDATORS
= [
102 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
105 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
108 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
111 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
116 # Internationalization
117 # https://docs.djangoproject.com/en/3.2/topics/i18n/
119 LANGUAGE_CODE
= 'en-us'
130 # Static files (CSS, JavaScript, Images)
131 # https://docs.djangoproject.com/en/3.2/howto/static-files/
133 STATIC_URL
= '/static/'
134 STATIC_ROOT
= BASE_DIR
/ 'static'
136 STATICFILES_DIRS
= [BASE_DIR
/ 'notes/static']
138 # Default primary key field type
139 # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
141 DEFAULT_AUTO_FIELD
= 'django.db.models.BigAutoField'
143 MEDIA_URL
= '/media/'
144 MEDIA_ROOT
= BASE_DIR
/ 'media'
patrick-canterino.de