thejagstudio commited on
Commit
092473a
·
verified ·
1 Parent(s): bbe929e

Update oneOone/settings.py

Browse files
Files changed (1) hide show
  1. oneOone/settings.py +174 -170
oneOone/settings.py CHANGED
@@ -1,170 +1,174 @@
1
- """
2
- Django settings for oneOone project.
3
-
4
- Generated by 'django-admin startproject' using Django 4.2.16.
5
-
6
- For more information on this file, see
7
- https://docs.djangoproject.com/en/4.2/topics/settings/
8
-
9
- For the full list of settings and their values, see
10
- https://docs.djangoproject.com/en/4.2/ref/settings/
11
- """
12
-
13
- from datetime import timedelta
14
- from pathlib import Path
15
-
16
- # Build paths inside the project like this: BASE_DIR / 'subdir'.
17
- BASE_DIR = Path(__file__).resolve().parent.parent
18
-
19
-
20
- # Quick-start development settings - unsuitable for production
21
- # See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
22
-
23
- # SECURITY WARNING: keep the secret key used in production secret!
24
- SECRET_KEY = "django-insecure-8&2s2s)--3hof($4+pkt0@$l1tz8so+$t=%yq9y0on=s$2_^$p"
25
-
26
- # SECURITY WARNING: don't run with debug turned on in production!
27
- DEBUG = True
28
-
29
- ALLOWED_HOSTS = ["*", "127.0.0.1", "192.168.81.1", "192.168.12.61"]
30
- CORS_ALLOWED_ORIGINS = [
31
- "http://localhost:8081",
32
- "http://localhost:19006",
33
- "http://192.168.81.1:8000",
34
- "http://192.168.12.61:8000",
35
- "https://s4t6xdgk-8000.inc1.devtunnels.ms"
36
- ]
37
- CSRF_TRUSTED_ORIGINS = [
38
- "http://localhost:8081",
39
- "http://192.168.81.1:8000",
40
- "http://192.168.12.61:8000",
41
- "http://localhost:19006",
42
- "https://s4t6xdgk-8000.inc1.devtunnels.ms"
43
- ]
44
-
45
- # Application definition
46
-
47
- INSTALLED_APPS = [
48
- "django.contrib.admin",
49
- "django.contrib.auth",
50
- "django.contrib.contenttypes",
51
- "django.contrib.sessions",
52
- "django.contrib.messages",
53
- "django.contrib.staticfiles",
54
- "rest_framework",
55
- "rest_framework_simplejwt",
56
- "import_export",
57
- "corsheaders"
58
- ]
59
-
60
- MIDDLEWARE = [
61
- "django.middleware.security.SecurityMiddleware",
62
- "django.contrib.sessions.middleware.SessionMiddleware",
63
- "corsheaders.middleware.CorsMiddleware",
64
- "django.middleware.common.CommonMiddleware",
65
- "django.middleware.csrf.CsrfViewMiddleware",
66
- "django.contrib.auth.middleware.AuthenticationMiddleware",
67
- "django.contrib.messages.middleware.MessageMiddleware",
68
- "django.middleware.clickjacking.XFrameOptionsMiddleware",
69
- ]
70
-
71
- ROOT_URLCONF = "oneOone.urls"
72
-
73
- TEMPLATES = [
74
- {
75
- "BACKEND": "django.template.backends.django.DjangoTemplates",
76
- "DIRS": [],
77
- "APP_DIRS": True,
78
- "OPTIONS": {
79
- "context_processors": [
80
- "django.template.context_processors.debug",
81
- "django.template.context_processors.request",
82
- "django.contrib.auth.context_processors.auth",
83
- "django.contrib.messages.context_processors.messages",
84
- ],
85
- },
86
- },
87
- ]
88
-
89
- WSGI_APPLICATION = "oneOone.wsgi.application"
90
-
91
-
92
- # Database
93
- # https://docs.djangoproject.com/en/4.2/ref/settings/#databases
94
-
95
- DATABASES = {
96
- 'default': {
97
- 'ENGINE': 'django.db.backends.postgresql',
98
- 'NAME': 'postgres',
99
- 'USER': 'postgres.psjobjezrtkjvenhsmge',
100
- 'PORT': 6543,
101
- 'PASSWORD': 'ErO9vgKcwCA1bdah',
102
- 'HOST': 'aws-0-us-east-1.pooler.supabase.com',
103
- }
104
- }
105
- # "default": {
106
- # "ENGINE": "django.db.backends.sqlite3",
107
- # "NAME": BASE_DIR / "db.sqlite3",
108
- # }
109
-
110
-
111
- # Password validation
112
- # https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
113
-
114
- AUTH_PASSWORD_VALIDATORS = [
115
- {
116
- "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
117
- },
118
- {
119
- "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
120
- },
121
- {
122
- "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
123
- },
124
- {
125
- "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
126
- },
127
- ]
128
-
129
-
130
- # Internationalization
131
- # https://docs.djangoproject.com/en/4.2/topics/i18n/
132
-
133
- LANGUAGE_CODE = "en-us"
134
-
135
- TIME_ZONE = "UTC"
136
-
137
- USE_I18N = True
138
-
139
- USE_TZ = True
140
-
141
-
142
- # Static files (CSS, JavaScript, Images)
143
- # https://docs.djangoproject.com/en/4.2/howto/static-files/
144
-
145
- STATIC_URL = "static/"
146
-
147
- # Default primary key field type
148
- # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
149
-
150
- DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
151
-
152
- REST_FRAMEWORK = {
153
- 'DEFAULT_AUTHENTICATION_CLASSES': (
154
- 'rest_framework_simplejwt.authentication.JWTAuthentication',
155
- ),
156
- 'DEFAULT_PERMISSION_CLASSES': (
157
- 'rest_framework.permissions.AllowAny',
158
- ),
159
- }
160
-
161
-
162
- SIMPLE_JWT = {
163
- 'ACCESS_TOKEN_LIFETIME': timedelta(minutes=5),
164
- 'REFRESH_TOKEN_LIFETIME': timedelta(days=1),
165
- 'ROTATE_REFRESH_TOKENS': True,
166
- 'BLACKLIST_AFTER_ROTATION': True,
167
- 'UPDATE_LAST_LOGIN': False,
168
- }
169
-
170
- EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
 
 
 
 
 
1
+ """
2
+ Django settings for oneOone project.
3
+
4
+ Generated by 'django-admin startproject' using Django 4.2.16.
5
+
6
+ For more information on this file, see
7
+ https://docs.djangoproject.com/en/4.2/topics/settings/
8
+
9
+ For the full list of settings and their values, see
10
+ https://docs.djangoproject.com/en/4.2/ref/settings/
11
+ """
12
+
13
+ from datetime import timedelta
14
+ from pathlib import Path
15
+
16
+ # Build paths inside the project like this: BASE_DIR / 'subdir'.
17
+ BASE_DIR = Path(__file__).resolve().parent.parent
18
+
19
+
20
+ # Quick-start development settings - unsuitable for production
21
+ # See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
22
+
23
+ # SECURITY WARNING: keep the secret key used in production secret!
24
+ SECRET_KEY = "django-insecure-8&2s2s)--3hof($4+pkt0@$l1tz8so+$t=%yq9y0on=s$2_^$p"
25
+
26
+ # SECURITY WARNING: don't run with debug turned on in production!
27
+ DEBUG = True
28
+
29
+ ALLOWED_HOSTS = ["*", "127.0.0.1", "192.168.81.1", "192.168.12.61", "thejagstudio-101.hf.space"]
30
+ CORS_ALLOWED_ORIGINS = [
31
+ "http://localhost:8081",
32
+ "http://localhost:19006",
33
+ "http://192.168.81.1:8000",
34
+ "http://192.168.12.61:8000",
35
+ "https://s4t6xdgk-8000.inc1.devtunnels.ms",
36
+ "http://thejagstudio-101.hf.space",
37
+ "https://thejagstudio-101.hf.space"
38
+ ]
39
+ CSRF_TRUSTED_ORIGINS = [
40
+ "http://localhost:8081",
41
+ "http://192.168.81.1:8000",
42
+ "http://192.168.12.61:8000",
43
+ "http://localhost:19006",
44
+ "https://s4t6xdgk-8000.inc1.devtunnels.ms",
45
+ "http://thejagstudio-101.hf.space",
46
+ "https://thejagstudio-101.hf.space"
47
+ ]
48
+
49
+ # Application definition
50
+
51
+ INSTALLED_APPS = [
52
+ "django.contrib.admin",
53
+ "django.contrib.auth",
54
+ "django.contrib.contenttypes",
55
+ "django.contrib.sessions",
56
+ "django.contrib.messages",
57
+ "django.contrib.staticfiles",
58
+ "rest_framework",
59
+ "rest_framework_simplejwt",
60
+ "import_export",
61
+ "corsheaders"
62
+ ]
63
+
64
+ MIDDLEWARE = [
65
+ "django.middleware.security.SecurityMiddleware",
66
+ "django.contrib.sessions.middleware.SessionMiddleware",
67
+ "corsheaders.middleware.CorsMiddleware",
68
+ "django.middleware.common.CommonMiddleware",
69
+ "django.middleware.csrf.CsrfViewMiddleware",
70
+ "django.contrib.auth.middleware.AuthenticationMiddleware",
71
+ "django.contrib.messages.middleware.MessageMiddleware",
72
+ "django.middleware.clickjacking.XFrameOptionsMiddleware",
73
+ ]
74
+
75
+ ROOT_URLCONF = "oneOone.urls"
76
+
77
+ TEMPLATES = [
78
+ {
79
+ "BACKEND": "django.template.backends.django.DjangoTemplates",
80
+ "DIRS": [],
81
+ "APP_DIRS": True,
82
+ "OPTIONS": {
83
+ "context_processors": [
84
+ "django.template.context_processors.debug",
85
+ "django.template.context_processors.request",
86
+ "django.contrib.auth.context_processors.auth",
87
+ "django.contrib.messages.context_processors.messages",
88
+ ],
89
+ },
90
+ },
91
+ ]
92
+
93
+ WSGI_APPLICATION = "oneOone.wsgi.application"
94
+
95
+
96
+ # Database
97
+ # https://docs.djangoproject.com/en/4.2/ref/settings/#databases
98
+
99
+ DATABASES = {
100
+ 'default': {
101
+ 'ENGINE': 'django.db.backends.postgresql',
102
+ 'NAME': 'postgres',
103
+ 'USER': 'postgres.psjobjezrtkjvenhsmge',
104
+ 'PORT': 6543,
105
+ 'PASSWORD': 'ErO9vgKcwCA1bdah',
106
+ 'HOST': 'aws-0-us-east-1.pooler.supabase.com',
107
+ }
108
+ }
109
+ # "default": {
110
+ # "ENGINE": "django.db.backends.sqlite3",
111
+ # "NAME": BASE_DIR / "db.sqlite3",
112
+ # }
113
+
114
+
115
+ # Password validation
116
+ # https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
117
+
118
+ AUTH_PASSWORD_VALIDATORS = [
119
+ {
120
+ "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
121
+ },
122
+ {
123
+ "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
124
+ },
125
+ {
126
+ "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
127
+ },
128
+ {
129
+ "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
130
+ },
131
+ ]
132
+
133
+
134
+ # Internationalization
135
+ # https://docs.djangoproject.com/en/4.2/topics/i18n/
136
+
137
+ LANGUAGE_CODE = "en-us"
138
+
139
+ TIME_ZONE = "UTC"
140
+
141
+ USE_I18N = True
142
+
143
+ USE_TZ = True
144
+
145
+
146
+ # Static files (CSS, JavaScript, Images)
147
+ # https://docs.djangoproject.com/en/4.2/howto/static-files/
148
+
149
+ STATIC_URL = "static/"
150
+
151
+ # Default primary key field type
152
+ # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
153
+
154
+ DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
155
+
156
+ REST_FRAMEWORK = {
157
+ 'DEFAULT_AUTHENTICATION_CLASSES': (
158
+ 'rest_framework_simplejwt.authentication.JWTAuthentication',
159
+ ),
160
+ 'DEFAULT_PERMISSION_CLASSES': (
161
+ 'rest_framework.permissions.AllowAny',
162
+ ),
163
+ }
164
+
165
+
166
+ SIMPLE_JWT = {
167
+ 'ACCESS_TOKEN_LIFETIME': timedelta(minutes=5),
168
+ 'REFRESH_TOKEN_LIFETIME': timedelta(days=1),
169
+ 'ROTATE_REFRESH_TOKENS': True,
170
+ 'BLACKLIST_AFTER_ROTATION': True,
171
+ 'UPDATE_LAST_LOGIN': False,
172
+ }
173
+
174
+ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'