django.core.exceptions.ImproperlyConfigured: WSGI application 'application' could not be loaded

前端 未结 14 2963
[愿得一人]
[愿得一人] 2021-02-20 06:19

The scenario is,

I cloned the Django code for OpenShift-V3 from here . When I run the code using python manage.py runserver getting an error as,

14条回答
  •  佛祖请我去吃肉
    2021-02-20 06:26

    maybe using middleware is the simple way to fix this , this problem mostly happens about cors Policy

    Code:

    class CorsMiddleware(object):
       def __init__(self, get_response):
          self.get_response = get_response
    
       def __call__(self, request):
          return self.get_response(request)
    
       def process_response(self,resp):
          resp["Access-Control-Allow-Origin"] = "*"
          return resp
    

提交回复
热议问题