'AnonymousUser' object has no attribute 'is_admin'

后端 未结 2 590
旧巷少年郎
旧巷少年郎 2021-01-28 22:42

I am using Django 2.2 and Python 3.6.

I deployed a Django REST server using AWS EB, but I get the following error.

It works fine on the local side, but an error oc

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-28 23:05

    The problem I encountered was the same as the cause in this question.

    This is also a known issue on the AWS forums.

    You can fix it in the following way:

    # .ebextensions/wsgihacks.config
    
    files:
      "/etc/httpd/conf.d/wsgihacks.conf":
        mode: "000644"
        owner: root
        group: root
        content: |
          WSGIPassAuthorization on
    

    Original thread: https://forums.aws.amazon.com/message.jspa?messageID=376244

提交回复
热议问题