TIL 210511
2021. 5. 12. 15:56ใ๐ TIL
[Python - Django]
- DRF REST API
- Django - React ์ฐ๋
github.com/tbnsok40/DRF-tutorial
CORS trouble shooting
- ์ฅ๊ณ - ๋ฆฌ์กํธ ์ฐ๋๊ณผ์ ์์ CORS ๋ฐ์ ์
# In django project/settings.py
>>> terminal) pip install django-cors-headers
INSTALLED_APPS = [
...
'corsheaders', # ์ถ๊ฐ
]
# ์ถ๊ฐ
CORS_ORIGIN_WHITELIST = ['http://localhost:3000']
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware', # ์ถ๊ฐ
'django.middleware.common.CommonMiddleware', # ์ถ๊ฐ
...
]
'๐ TIL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
TIL 210517 (0) | 2021.05.17 |
---|---|
5์ ์ ์งธ ์ฃผ ์ฃผ๊ฐํ๊ณ (0) | 2021.05.16 |
TIL 210510 (0) | 2021.05.11 |
5์ ๋์งธ ์ฃผ ์ฃผ๊ฐํ๊ณ (0) | 2021.05.09 |
TIL 210506 (0) | 2021.05.06 |