2

I have one Django web service application running in domain A. The application uses a content file for storing some HTML files and images needed it. Another application running on domain B want to access my services and content. I enabled CORS in my domain A. Now I can access web services running on domain A from domain B and also the image files from domain A. But I have some HTML in the content file. I can't access that HTML content from domain B.

Domain B implemented using angularjs which useses ng-include to render my HTML page. CORS also enabled in domain B.

Application settings.py domain A

INSTALLED_APPS = (
        'corsheaders',
)

# CORS HEADERS settings
CORS_ORIGIN_ALLOW_ALL = True  # Default False
CORS_ALLOW_METHODS = (
'GET',
'POST',
'PUT',
'PATCH',
'DELETE',
'OPTIONS'
)
CORS_ALLOW_HEADERS = (
'x-requested-with',
'content-type',
'accept',
'origin',
'authorization'
)
Kevin Brown-Silva
  • 40,873
  • 40
  • 203
  • 237

1 Answers1

1

Check your response headers and make sure they are carrying the all the proper Access-Control-Allow-* headers. CORS requests require preflight success.

See my answer here for more information.

Community
  • 1
  • 1
J.Wells
  • 1,749
  • 12
  • 13