'WSGIRequest' object has no attribute 'user' Django admin

后端 未结 8 1305
感动是毒
感动是毒 2020-11-29 01:08

When I trying to access the admin page it gives me the following error:

System check identified no issues (0 silenced).
June 21, 2016 - 15:26:14
Django versi         


        
8条回答
  •  无人及你
    2020-11-29 01:50

    You should not change MIDDLEWARE to MIDDLEWARE_CLASSES. What happens here is more likely that you created the app with django 1.10 and now you are running it with 1.9 or a previous version.

    Make sure you use a specific version of django(and all other libraries) so your project doesn't break when deploying or running on different machines.

    If you have a stable codebase simply run:

    pip freeze > requirements.txt
    

    And then when deploying or setting up a new env just do:

    pip install -r requirements.txt
    

    You should always consider using fixed versions of your libraries(and hopefully virtual envs), and when upgrading dependencies test each version change.

提交回复
热议问题