· 4 years ago · Apr 05, 2021, 06:32 PM
1"""
2Django settings for easy_student project.
3
4Generated by 'django-admin startproject' using Django 3.1.6.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/3.1/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/3.1/ref/settings/
11"""
12
13from pathlib import Path
14
15# Build paths inside the project like this: BASE_DIR / 'subdir'.
16BASE_DIR = Path(__file__).resolve().parent.parent
17
18
19# Quick-start development settings - unsuitable for production
20# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
21
22# SECURITY WARNING: keep the secret key used in production secret!
23SECRET_KEY = 'f5l_judvh&#c-m_o_k2yo-2jc-v2f-7nc(a^y%21cwjxkbv9v&'
24
25# SECURITY WARNING: don't run with debug turned on in production!
26DEBUG = True
27
28ALLOWED_HOSTS = []
29
30
31# Application definition
32
33INSTALLED_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 'crispy_forms',
41 'main.apps.MainConfig',
42 'frontend.apps.FrontendConfig',
43 'table.apps.TableConfig',
44 'api.apps.ApiConfig',
45 'quiz.apps.QuizConfig',
46]
47
48MIDDLEWARE = [
49 'django.middleware.security.SecurityMiddleware',
50 'django.contrib.sessions.middleware.SessionMiddleware',
51 'django.middleware.common.CommonMiddleware',
52 'django.middleware.csrf.CsrfViewMiddleware',
53 'django.contrib.auth.middleware.AuthenticationMiddleware',
54 'django.contrib.messages.middleware.MessageMiddleware',
55 'django.middleware.clickjacking.XFrameOptionsMiddleware',
56]
57
58ROOT_URLCONF = 'easy_student.urls'
59
60TEMPLATES = [
61 {
62 'BACKEND': 'django.template.backends.django.DjangoTemplates',
63 'DIRS': [BASE_DIR / 'templates']
64 ,
65 'APP_DIRS': True,
66 'OPTIONS': {
67 'context_processors': [
68 'django.template.context_processors.debug',
69 'django.template.context_processors.request',
70 'django.contrib.auth.context_processors.auth',
71 'django.contrib.messages.context_processors.messages',
72 ],
73 },
74 },
75]
76
77WSGI_APPLICATION = 'easy_student.wsgi.application'
78
79
80# Database
81# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
82
83DATABASES = {
84 'default': {
85 'ENGINE': 'django.db.backends.postgresql',
86 'NAME': 'akyyeqjw',
87 'USER': 'akyyeqjw',
88 'PASSWORD': 'FCsTa_KXmqmbkjOwwIpE1pWcZeyCb-bq',
89 'HOST': 'ziggy.db.elephantsql.com',
90 'PORT': '5432'
91 }
92}
93
94
95# Password validation
96# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
97
98AUTH_PASSWORD_VALIDATORS = [
99 {
100 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
101 },
102 {
103 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
104 },
105 {
106 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
107 },
108 {
109 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
110 },
111]
112
113
114# Internationalization
115# https://docs.djangoproject.com/en/3.1/topics/i18n/
116
117LANGUAGE_CODE = 'en-us'
118
119TIME_ZONE = 'UTC'
120
121USE_I18N = True
122
123USE_L10N = True
124
125USE_TZ = True
126
127
128# Static files (CSS, JavaScript, Images)
129# https://docs.djangoproject.com/en/3.1/howto/static-files/
130
131STATIC_URL = "/static/"
132
133STATIC_ROOT = BASE_DIR / "frontend/static/"
134
135CRISPY_TEMPLATE_PACK = 'bootstrap4'
136
137LOGIN_URL = "main:login"
138