pip install django-cors-headers
INSTALLED_APPS =[ #... 'corsheaders' ] MIDDLEWARE = [ 'corsheaders.middleware.CorsMiddleware', #최상단에 추가해주기 #... ] CORS_ALLOWED_ORIGINS = [ # 허용할 Origin 추가 "https://example.com", "https://sub.example.com", "http://localhost:8080", "http://127.0.0.1:9000" ] 상황에 따라 모든 도메인에 대해서도 추가가 가능합니다 CORS_ORIGIN_ALLOW_ALL = True