Skip to content

Commit

Permalink
Fix/cors issues (#33)
Browse files Browse the repository at this point in the history
* fix: solving the CORS issues

* feat: updates to code

* changes to code owners

* feat: updates to code
  • Loading branch information
yokwejuste authored Sep 21, 2024
1 parent d364612 commit 35db59f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@yokwejuste @Edmond22-prog @LL-Etiane @Leo-Youmbi
@yokwejuste @Edmond22-prog @LL-Etiane @yll0rd
5 changes: 4 additions & 1 deletion website_api/settings/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"whitenoise.middleware.WhiteNoiseMiddleware",
]



# CORS configuration
CORS_ALLOW_ALL_ORIGINS = True

Expand All @@ -41,6 +43,7 @@

CORS_ORIGIN_WHITELIST = [
"http://localhost",
"https://www.djangocameroon.site",
"https://djangocameroon.site",
"https://beta.djangocameroon.site",
"https://www.djangocameroon.site",
]
6 changes: 1 addition & 5 deletions website_api/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@

ALLOWED_HOSTS = (os.environ.get("ALLOWED_HOSTS", "*")).split(",")

CORS_ALLOWED_ORIGINS = (
os.environ.get("CORS_ALLOWED_ORIGINS", "https://127.0.0.1:3000")
).split(",")

INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
Expand All @@ -40,7 +36,7 @@
"django.middleware.clickjacking.XFrameOptionsMiddleware",
]

MIDDLEWARE = BASE_MIDDLEWARE + EXTRA_MIDDLEWARE
MIDDLEWARE = EXTRA_MIDDLEWARE + BASE_MIDDLEWARE

ROOT_URLCONF = "website_api.routes"

Expand Down
2 changes: 1 addition & 1 deletion website_api/settings/extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@
}
INTERNAL_IPS = [
'127.0.0.1',
]
]

0 comments on commit 35db59f

Please sign in to comment.