Skip to content

Commit

Permalink
feat(cors): Added corsheaders
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi0lii committed Jun 7, 2020
1 parent 74c49ce commit 502df53
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ django-environ = "*"
gunicorn = "*"
mysqlclient = "*"
requests = "*"
django-cors-headers = "*"

[requires]
python_version = "3.8"
16 changes: 12 additions & 4 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions carddeckserver/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'corsheaders',
]

MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
Expand Down Expand Up @@ -90,3 +92,6 @@

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')

# TODO: Change this, this is not suited for production use!
CORS_ORIGIN_ALLOW_ALL = True

0 comments on commit 502df53

Please sign in to comment.