|
| 1 | +from pathlib import Path |
| 2 | +import os |
| 3 | + |
| 4 | +# Build paths inside the project like this: BASE_DIR / 'subdir'. |
| 5 | +BASE_DIR = Path(__file__).resolve().parent.parent |
| 6 | + |
| 7 | + |
| 8 | +# Quick-start development settings - unsuitable for production |
| 9 | +# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ |
| 10 | + |
| 11 | +# SECURITY WARNING: keep the secret key used in production secret! |
| 12 | +SECRET_KEY = 'wy#+(&hxnf5$hd=wx)0mffwknu5h+@=u7&e%e%v8nlj!bd*4)l' |
| 13 | + |
| 14 | +# SECURITY WARNING: don't run with debug turned on in production! |
| 15 | +DEBUG = True |
| 16 | + |
| 17 | +ALLOWED_HOSTS = [] |
| 18 | + |
| 19 | + |
| 20 | +# Application definition |
| 21 | + |
| 22 | +INSTALLED_APPS = [ |
| 23 | + 'django.contrib.admin', |
| 24 | + 'django.contrib.auth', |
| 25 | + 'django.contrib.contenttypes', |
| 26 | + 'django.contrib.sessions', |
| 27 | + 'django.contrib.messages', |
| 28 | + 'django.contrib.staticfiles', |
| 29 | + 'home', |
| 30 | +] |
| 31 | + |
| 32 | +MIDDLEWARE = [ |
| 33 | + 'django.middleware.security.SecurityMiddleware', |
| 34 | + 'django.contrib.sessions.middleware.SessionMiddleware', |
| 35 | + 'django.middleware.common.CommonMiddleware', |
| 36 | + 'django.middleware.csrf.CsrfViewMiddleware', |
| 37 | + 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 38 | + 'django.contrib.messages.middleware.MessageMiddleware', |
| 39 | + 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 40 | +] |
| 41 | + |
| 42 | +ROOT_URLCONF = 'BloodDonation.urls' |
| 43 | + |
| 44 | +TEMPLATES = [ |
| 45 | + { |
| 46 | + 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
| 47 | + 'DIRS': ["home/templates"], |
| 48 | + 'APP_DIRS': True, |
| 49 | + 'OPTIONS': { |
| 50 | + 'context_processors': [ |
| 51 | + 'django.template.context_processors.debug', |
| 52 | + 'django.template.context_processors.request', |
| 53 | + 'django.contrib.auth.context_processors.auth', |
| 54 | + 'django.contrib.messages.context_processors.messages', |
| 55 | + ], |
| 56 | + }, |
| 57 | + }, |
| 58 | +] |
| 59 | + |
| 60 | +WSGI_APPLICATION = 'BloodDonation.wsgi.application' |
| 61 | + |
| 62 | + |
| 63 | +# Database |
| 64 | +# https://docs.djangoproject.com/en/3.1/ref/settings/#databases |
| 65 | + |
| 66 | +DATABASES = { |
| 67 | + 'default': { |
| 68 | + 'ENGINE': 'django.db.backends.sqlite3', |
| 69 | + 'NAME': BASE_DIR / 'db.sqlite3', |
| 70 | + } |
| 71 | +} |
| 72 | + |
| 73 | + |
| 74 | +# Password validation |
| 75 | +# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators |
| 76 | + |
| 77 | +AUTH_PASSWORD_VALIDATORS = [ |
| 78 | + { |
| 79 | + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
| 80 | + }, |
| 81 | + { |
| 82 | + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
| 83 | + }, |
| 84 | + { |
| 85 | + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
| 86 | + }, |
| 87 | + { |
| 88 | + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
| 89 | + }, |
| 90 | +] |
| 91 | + |
| 92 | + |
| 93 | +# Internationalization |
| 94 | +# https://docs.djangoproject.com/en/3.1/topics/i18n/ |
| 95 | + |
| 96 | +LANGUAGE_CODE = 'en-us' |
| 97 | + |
| 98 | +TIME_ZONE = 'UTC' |
| 99 | + |
| 100 | +USE_I18N = True |
| 101 | + |
| 102 | +USE_L10N = True |
| 103 | + |
| 104 | +USE_TZ = True |
| 105 | + |
| 106 | + |
| 107 | +# Static files (CSS, JavaScript, Images) |
| 108 | +# https://docs.djangoproject.com/en/3.1/howto/static-files/ |
| 109 | + |
| 110 | +STATIC_URL = '/static/' |
| 111 | + |
| 112 | +MEDIA_ROOT = os.path.join(BASE_DIR, 'home/media') |
| 113 | +MEDIA_URL = '/media/' |
| 114 | + |
| 115 | +STATICFILES_DIRS = [ |
| 116 | + os.path.join(BASE_DIR, "home/static") |
| 117 | +] |
| 118 | + |
0 commit comments