I have a client with a django web application which pulls information from a different web application and displays it on a web page.
The web application suddenly stopped working and the following message appeared in the server's supervisorctl:
https://i.stack.imgur.com/xG3ig.jpg
I didn't have much time, so I traced the error to the CorsHeaders middleware and commented it out from the website's settings.py while I work on a long term solution. To save people time researching, Cors is a middleware which allows web browsers to access your server even if it is in a different domain than the web page. (aka what the client uses to upload their data from one webapp to another)
This image outlines what I commented out: https://i.stack.imgur.com/emRNC.jpg
As mentioned, commenting out that middleware prevented it from loading any new data but the current graphs had no issues being displayed. This confirmed my suspicion that corsheaders was the sole problem.
Now I had a bit more time to research the issue at home and realized that the crux of the issue is the fact that the middleware is what calls on the apps import:
https://i.stack.imgur.com/fLvaK.jpg
Now I will admit that while I have some python experience, I have no experience with Django and I have no idea how its apps work or what that import is doing. I ran
find /path/to/django/ -name "apps"
and also,
find /path/to/django/ -name "apps.py"
and I got 0 hits. I'm not even sure that this django.apps exists in Django 1.3.1 which is what this client is running along with python 2.6.6
I have already considered an upgrade but there are loads of other applications running on the server that a python or django upgrade is out of the question. Is there any way to resolve this?