Skip to content

Commit

Permalink
Add CORS (#97)
Browse files Browse the repository at this point in the history
* Add CORS

* cars 2
  • Loading branch information
WillNilges authored Jan 20, 2024
1 parent a40ed1c commit ccd8878
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies = [
"phonenumbers==8.13.*",
"requests==2.31.*",
"geopy==2.4.*",
"django-cors-headers==4.3.*",
]

[project.optional-dependencies]
Expand Down
7 changes: 7 additions & 0 deletions src/meshdb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
"nginx",
]

CORS_ALLOWED_ORIGINS = [
"http://127.0.0.1:3000",
"http://localhost:3000",
]

CSRF_TRUSTED_ORIGINS = [
"https://meshdb.mesh",
"https://meshdb.mesh.nycmesh.net",
Expand All @@ -61,10 +66,12 @@
"rest_framework",
"rest_framework.authtoken",
"meshapi",
"corsheaders",
]

MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"corsheaders.middleware.CorsMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
Expand Down

0 comments on commit ccd8878

Please sign in to comment.