Skip to content

Instantly share code, notes, and snippets.

@parkjoohwan
Created February 3, 2020 08:03
Show Gist options
  • Select an option

  • Save parkjoohwan/ab961377119bae8c35abdf6b1ee7c1d1 to your computer and use it in GitHub Desktop.

Select an option

Save parkjoohwan/ab961377119bae8c35abdf6b1ee7c1d1 to your computer and use it in GitHub Desktop.
django cross domain

settings.py

CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_CREDENTIALS = False

MIDDLEWARE 에 추가
'corsheaders.middleware.CorsMiddleware',
'corsheaders.middleware.CorsPostCsrfMiddleware',

MIDDLEWARE 에서 삭제 - 주석처리
'django.middleware.csrf.CsrfViewMiddleware',

INSTALLED_APPS 에 추가
'corsheaders' ,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment