1 | # settings.py
|
---|
2 |
|
---|
3 | """
|
---|
4 | Django settings for LunchTracker project.
|
---|
5 |
|
---|
6 | Generated by 'django-admin startproject' using Django 3.2.11.
|
---|
7 |
|
---|
8 | For more information on this file, see
|
---|
9 | https://docs.djangoproject.com/en/3.2/topics/settings/
|
---|
10 |
|
---|
11 | For the full list of settings and their values, see
|
---|
12 | https://docs.djangoproject.com/en/3.2/ref/settings/
|
---|
13 | """
|
---|
14 |
|
---|
15 | from pathlib import Path
|
---|
16 |
|
---|
17 | # Build paths inside the project like this: BASE_DIR / 'subdir'.
|
---|
18 | BASE_DIR = Path(__file__).resolve().parent.parent
|
---|
19 |
|
---|
20 | # Quick-start development settings - unsuitable for production
|
---|
21 | # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
|
---|
22 |
|
---|
23 | # SECURITY WARNING: keep the secret key used in production secret!
|
---|
24 | SECRET_KEY = 'django-insecure-nz+-r#cr25v(kbrj3zpx*wp087ir#t85d+$ilc^hz41n0*#wb='
|
---|
25 |
|
---|
26 | # SECURITY WARNING: don't run with debug turned on in production!
|
---|
27 | DEBUG = True
|
---|
28 |
|
---|
29 | ALLOWED_HOSTS = []
|
---|
30 |
|
---|
31 | # Application definition
|
---|
32 |
|
---|
33 | INSTALLED_APPS = [
|
---|
34 | 'django.contrib.admin',
|
---|
35 | 'django.contrib.auth',
|
---|
36 | 'django.contrib.contenttypes',
|
---|
37 | 'django.contrib.sessions',
|
---|
38 | 'django.contrib.messages',
|
---|
39 | 'django.contrib.staticfiles',
|
---|
40 | 'axes',
|
---|
41 | 'easyaudit',
|
---|
42 | ]
|
---|
43 |
|
---|
44 | AUTHENTICATION_BACKENDS = [
|
---|
45 | 'axes.backends.AxesBackend',
|
---|
46 | 'django.contrib.auth.backends.ModelBackend',
|
---|
47 | ]
|
---|
48 |
|
---|
49 | MIDDLEWARE = [
|
---|
50 | 'django.middleware.security.SecurityMiddleware',
|
---|
51 | 'django.contrib.sessions.middleware.SessionMiddleware',
|
---|
52 | 'django.middleware.common.CommonMiddleware',
|
---|
53 | 'django.middleware.csrf.CsrfViewMiddleware',
|
---|
54 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
|
---|
55 | 'django.contrib.messages.middleware.MessageMiddleware',
|
---|
56 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
---|
57 | 'easyaudit.middleware.easyaudit.EasyAuditMiddleware',
|
---|
58 | 'axes.middleware.AxesMiddleware',
|
---|
59 | ]
|
---|
60 |
|
---|
61 | ROOT_URLCONF = 'LunchTracker.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 = 'LunchTracker.wsgi.application'
|
---|
80 |
|
---|
81 | # Database
|
---|
82 | # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
|
---|
83 |
|
---|
84 | # DATABASES = {
|
---|
85 | # 'default': {
|
---|
86 | # 'ENGINE': 'django.db.backends.sqlite3',
|
---|
87 | # 'NAME': BASE_DIR / 'db.sqlite3',
|
---|
88 | # }
|
---|
89 | # }
|
---|
90 |
|
---|
91 | DATABASES = {
|
---|
92 | 'default': {
|
---|
93 | 'ENGINE': 'mysql.connector.django',
|
---|
94 | 'NAME': <db_name>,
|
---|
95 | 'USER': <db_user_name>,
|
---|
96 | 'PASSWORD': <password>,
|
---|
97 | 'HOST': 'localhost',
|
---|
98 | 'PORT': '3306',
|
---|
99 | 'OPTIONS': {
|
---|
100 | 'use_pure': False,
|
---|
101 | 'raise_on_warnings': False,
|
---|
102 | }
|
---|
103 | }
|
---|
104 | }
|
---|
105 |
|
---|
106 | # Password validation
|
---|
107 | # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
|
---|
108 |
|
---|
109 | AUTH_PASSWORD_VALIDATORS = [
|
---|
110 | {
|
---|
111 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
---|
112 | },
|
---|
113 | {
|
---|
114 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
---|
115 | },
|
---|
116 | {
|
---|
117 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
---|
118 | },
|
---|
119 | {
|
---|
120 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
---|
121 | },
|
---|
122 | ]
|
---|
123 |
|
---|
124 | # Internationalization
|
---|
125 | # https://docs.djangoproject.com/en/3.2/topics/i18n/
|
---|
126 |
|
---|
127 | LANGUAGE_CODE = 'en-us'
|
---|
128 |
|
---|
129 | TIME_ZONE = 'Africa/Kampala'
|
---|
130 |
|
---|
131 | USE_I18N = True
|
---|
132 |
|
---|
133 | USE_L10N = True
|
---|
134 |
|
---|
135 | USE_TZ = False
|
---|
136 |
|
---|
137 | # Static files (CSS, JavaScript, Images)
|
---|
138 | # https://docs.djangoproject.com/en/3.2/howto/static-files/
|
---|
139 |
|
---|
140 | STATIC_URL = '/static/'
|
---|
141 |
|
---|
142 | # Default primary key field type
|
---|
143 | # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
|
---|
144 |
|
---|
145 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
---|
146 |
|
---|