Skip to content

Commit

Permalink
allow calling BE from browser on localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrembecky committed Dec 16, 2024
1 parent 6cd65a3 commit 215e0a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dill==0.3.9
dj-rest-auth==5.0.2
Django==4.2.17
django-allauth==0.58.2
django-cors-headers==4.6.0
django-filter==23.5
django-rest-swagger==2.2.0
django-sendfile2==0.7.1
Expand Down
7 changes: 7 additions & 0 deletions webstrom/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
'https://localhost:3000'
]

CORS_ALLOWED_ORIGINS = [
'http://localhost:3000',
]
CORS_ALLOW_CREDENTIALS = True

# Application definition

DJANGO_APPS = [
Expand All @@ -39,6 +44,7 @@
'dj_rest_auth',
'django_filters',
'rest_framework_swagger',
"corsheaders",
]

LOCAL_APPS = [
Expand All @@ -61,6 +67,7 @@
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'allauth.account.middleware.AccountMiddleware',
"corsheaders.middleware.CorsMiddleware",
]

ROOT_URLCONF = 'webstrom.urls'
Expand Down

0 comments on commit 215e0a5

Please sign in to comment.