I'm encountering an issue with CORS middleware not working in my Django application deployed on Google App Engine. Despite following the recommended steps, including installing the django-cors-headers package, adding it to the INSTALLED_APPS and MIDDLEWARE settings, and ensuring I'm using a virtual environment, the CORS headers are not being applied in the deployed environment.
Steps Taken:
Installed django-cors-headers in my virtual environment using pip install django-cors-headers. Added 'corsheaders' to the INSTALLED_APPS list in my Django settings (settings.py). Included 'corsheaders.middleware.CorsMiddleware' in the MIDDLEWARE list in my Django settings. Confirmed that the virtual environment is activated during deployment. Redeployed the application to Google App Engine after making the above changes.
Expected Behavior: I expect the CORS middleware to add the necessary CORS headers to responses, allowing cross-origin requests to be processed correctly by my Django application deployed on Google App Engine.
Actual Behavior: Despite following the steps above and redeploying the application, CORS headers are not being added to responses, resulting in CORS-related errors in client-side requests.