JaivinBarot commited on
Commit
37de623
·
verified ·
1 Parent(s): 4bf213a

Update ExamscheduleViewer/settings.py

Browse files
Files changed (1) hide show
  1. ExamscheduleViewer/settings.py +139 -139
ExamscheduleViewer/settings.py CHANGED
@@ -1,139 +1,139 @@
1
- """
2
- Django settings for ExamscheduleViewer project.
3
-
4
- Generated by 'django-admin startproject' using Django 5.0.4.
5
-
6
- For more information on this file, see
7
- https://docs.djangoproject.com/en/5.0/topics/settings/
8
-
9
- For the full list of settings and their values, see
10
- https://docs.djangoproject.com/en/5.0/ref/settings/
11
- """
12
-
13
- from pathlib import Path
14
- from dotenv import load_dotenv
15
- import os
16
- load_dotenv()
17
-
18
- # Build paths inside the project like this: BASE_DIR / 'subdir'.
19
- BASE_DIR = Path(__file__).resolve().parent.parent
20
-
21
-
22
- # Quick-start development settings - unsuitable for production
23
- # See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
24
-
25
- # SECURITY WARNING: keep the secret key used in production secret!
26
- SECRET_KEY = 'django-insecure-**@-tuvqyk^ildsh4(g7t^dqa5-9t$n)i6a3+k7wo$9as-r+@d'
27
-
28
- # SECURITY WARNING: don't run with debug turned on in production!
29
- DEBUG = True
30
-
31
- ALLOWED_HOSTS = ["*"]
32
-
33
-
34
- # Application definition
35
-
36
- INSTALLED_APPS = [
37
- 'django.contrib.admin',
38
- 'django.contrib.auth',
39
- 'django.contrib.contenttypes',
40
- 'django.contrib.sessions',
41
- 'django.contrib.messages',
42
- 'django.contrib.staticfiles',
43
- 'genrateExamSchedule',
44
- ]
45
-
46
- MIDDLEWARE = [
47
- 'django.middleware.security.SecurityMiddleware',
48
- 'django.contrib.sessions.middleware.SessionMiddleware',
49
- 'django.middleware.common.CommonMiddleware',
50
- 'django.middleware.csrf.CsrfViewMiddleware',
51
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
52
- 'django.contrib.messages.middleware.MessageMiddleware',
53
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
54
- ]
55
-
56
- ROOT_URLCONF = 'ExamscheduleViewer.urls'
57
-
58
- TEMPLATES = [
59
- {
60
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
61
- 'DIRS': ['templates'],
62
- 'APP_DIRS': True,
63
- 'OPTIONS': {
64
- 'context_processors': [
65
- 'django.template.context_processors.debug',
66
- 'django.template.context_processors.request',
67
- 'django.contrib.auth.context_processors.auth',
68
- 'django.contrib.messages.context_processors.messages',
69
-
70
- ],
71
- },
72
- },
73
- ]
74
-
75
- WSGI_APPLICATION = 'ExamscheduleViewer.wsgi.application'
76
-
77
-
78
- # Database
79
- # https://docs.djangoproject.com/en/5.0/ref/settings/#databases
80
-
81
- DATABASES = {
82
- # 'default': {
83
- # 'ENGINE': 'django.db.backends.sqlite3',
84
- # 'NAME': BASE_DIR / 'db.sqlite3',
85
- # }
86
- 'default': {
87
- 'ENGINE': 'django.db.backends.postgresql_psycopg2',
88
- 'NAME': os.environ.get('SUPABASE_DB_NAME'),
89
- 'USER': os.environ.get('SUPABASE_DB_USER'),
90
- 'PASSWORD': os.environ.get('SUPABASE_DB_PASSWORD'),
91
- 'HOST': os.environ.get('SUPABASE_DB_HOST'),
92
- 'PORT': os.environ.get('SUPABASE_DB_PORT'),
93
- 'OPTIONS': {
94
- 'sslmode': 'require', # Enforce SSL connection (recommended for Supabase)
95
- },
96
- }
97
- }
98
-
99
-
100
- # Password validation
101
- # https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
102
-
103
- AUTH_PASSWORD_VALIDATORS = [
104
- {
105
- 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
106
- },
107
- {
108
- 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
109
- },
110
- {
111
- 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
112
- },
113
- {
114
- 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
115
- },
116
- ]
117
-
118
-
119
- # Internationalization
120
- # https://docs.djangoproject.com/en/5.0/topics/i18n/
121
-
122
- LANGUAGE_CODE = 'en-us'
123
-
124
- TIME_ZONE = 'UTC'
125
-
126
- USE_I18N = True
127
-
128
- USE_TZ = True
129
-
130
-
131
- # Static files (CSS, JavaScript, Images)
132
- # https://docs.djangoproject.com/en/5.0/howto/static-files/
133
-
134
- STATIC_URL = 'static/'
135
-
136
- # Default primary key field type
137
- # https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
138
-
139
- DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
 
1
+ """
2
+ Django settings for ExamscheduleViewer project.
3
+
4
+ Generated by 'django-admin startproject' using Django 5.0.4.
5
+
6
+ For more information on this file, see
7
+ https://docs.djangoproject.com/en/5.0/topics/settings/
8
+
9
+ For the full list of settings and their values, see
10
+ https://docs.djangoproject.com/en/5.0/ref/settings/
11
+ """
12
+
13
+ from pathlib import Path
14
+
15
+ import os
16
+
17
+
18
+ # Build paths inside the project like this: BASE_DIR / 'subdir'.
19
+ BASE_DIR = Path(__file__).resolve().parent.parent
20
+
21
+
22
+ # Quick-start development settings - unsuitable for production
23
+ # See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
24
+
25
+ # SECURITY WARNING: keep the secret key used in production secret!
26
+ SECRET_KEY = 'django-insecure-**@-tuvqyk^ildsh4(g7t^dqa5-9t$n)i6a3+k7wo$9as-r+@d'
27
+
28
+ # SECURITY WARNING: don't run with debug turned on in production!
29
+ DEBUG = True
30
+
31
+ ALLOWED_HOSTS = ["*"]
32
+
33
+
34
+ # Application definition
35
+
36
+ INSTALLED_APPS = [
37
+ 'django.contrib.admin',
38
+ 'django.contrib.auth',
39
+ 'django.contrib.contenttypes',
40
+ 'django.contrib.sessions',
41
+ 'django.contrib.messages',
42
+ 'django.contrib.staticfiles',
43
+ 'genrateExamSchedule',
44
+ ]
45
+
46
+ MIDDLEWARE = [
47
+ 'django.middleware.security.SecurityMiddleware',
48
+ 'django.contrib.sessions.middleware.SessionMiddleware',
49
+ 'django.middleware.common.CommonMiddleware',
50
+ 'django.middleware.csrf.CsrfViewMiddleware',
51
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
52
+ 'django.contrib.messages.middleware.MessageMiddleware',
53
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
54
+ ]
55
+
56
+ ROOT_URLCONF = 'ExamscheduleViewer.urls'
57
+
58
+ TEMPLATES = [
59
+ {
60
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
61
+ 'DIRS': ['templates'],
62
+ 'APP_DIRS': True,
63
+ 'OPTIONS': {
64
+ 'context_processors': [
65
+ 'django.template.context_processors.debug',
66
+ 'django.template.context_processors.request',
67
+ 'django.contrib.auth.context_processors.auth',
68
+ 'django.contrib.messages.context_processors.messages',
69
+
70
+ ],
71
+ },
72
+ },
73
+ ]
74
+
75
+ WSGI_APPLICATION = 'ExamscheduleViewer.wsgi.application'
76
+
77
+
78
+ # Database
79
+ # https://docs.djangoproject.com/en/5.0/ref/settings/#databases
80
+
81
+ DATABASES = {
82
+ # 'default': {
83
+ # 'ENGINE': 'django.db.backends.sqlite3',
84
+ # 'NAME': BASE_DIR / 'db.sqlite3',
85
+ # }
86
+ 'default': {
87
+ 'ENGINE': 'django.db.backends.postgresql_psycopg2',
88
+ 'NAME': os.environ.get('SUPABASE_DB_NAME'),
89
+ 'USER': os.environ.get('SUPABASE_DB_USER'),
90
+ 'PASSWORD': os.environ.get('SUPABASE_DB_PASSWORD'),
91
+ 'HOST': os.environ.get('SUPABASE_DB_HOST'),
92
+ 'PORT': os.environ.get('SUPABASE_DB_PORT'),
93
+ 'OPTIONS': {
94
+ 'sslmode': 'require', # Enforce SSL connection (recommended for Supabase)
95
+ },
96
+ }
97
+ }
98
+
99
+
100
+ # Password validation
101
+ # https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
102
+
103
+ AUTH_PASSWORD_VALIDATORS = [
104
+ {
105
+ 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
106
+ },
107
+ {
108
+ 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
109
+ },
110
+ {
111
+ 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
112
+ },
113
+ {
114
+ 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
115
+ },
116
+ ]
117
+
118
+
119
+ # Internationalization
120
+ # https://docs.djangoproject.com/en/5.0/topics/i18n/
121
+
122
+ LANGUAGE_CODE = 'en-us'
123
+
124
+ TIME_ZONE = 'UTC'
125
+
126
+ USE_I18N = True
127
+
128
+ USE_TZ = True
129
+
130
+
131
+ # Static files (CSS, JavaScript, Images)
132
+ # https://docs.djangoproject.com/en/5.0/howto/static-files/
133
+
134
+ STATIC_URL = 'static/'
135
+
136
+ # Default primary key field type
137
+ # https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
138
+
139
+ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'