Skip to content

Commit

Permalink
Solve CORS issues when 2 Vite apps are running using default ports
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel-Therrien-Beslogic committed Jan 14, 2025
1 parent 46acb52 commit 1b28bb9
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions canopeum_backend/canopeum_backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def get_secret(key: str, default: str):

CSRF_TRUSTED_ORIGINS = [
"http://localhost:5173",
"http://localhost:5174",
"http://localhost:3000",
"http://releaftrees.life",
"https://releaftrees.life",
Expand All @@ -75,6 +76,7 @@ def get_secret(key: str, default: str):

CORS_ALLOWED_ORIGINS = [
"http://localhost:5173",
"http://localhost:5174",
"http://localhost:3000",
"http://releaftrees.life",
"https://releaftrees.life",
Expand All @@ -84,6 +86,7 @@ def get_secret(key: str, default: str):

CORS_ORIGIN_WHITELIST = [
"http://localhost:5173",
"http://localhost:5174",
"http://localhost:3000",
"http://releaftrees.life",
"https://releaftrees.life",
Expand Down Expand Up @@ -197,18 +200,10 @@ def get_secret(key: str, default: str):
AUTH_USER_MODEL = "canopeum_backend.User"

AUTH_PASSWORD_VALIDATORS = [
{
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
},
{
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
},
{
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
},
{
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
},
{"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"},
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
]

SIMPLE_JWT = {
Expand Down

0 comments on commit 1b28bb9

Please sign in to comment.