当我使用uwsgi在服务器上部署应用程序时,出现错误
AttributeError at /
'WSGIRequest' object has no attribute 'scope'
在本地计算机上没有这样的问题,一切正常。
出现此错误的代码部分:
class UserActivityMiddleware(MiddlewareMixin):
def process_response(self, request, response):
activities = [activity for activity in ACTIVITIES if re.match(activity['path'], request.scope.get('path'))
and activity['method'] == request.scope['method']]
if activities:
.....