简体   繁体   中英

Django admin only works with python 2

I'm using Django in a virtualenv. The admin page only works in python 2. When i run python3 manage.py runserver i get an error:

AttributeError at /admin/ 'WSGIRequest' object has no attribute 'user'

But when i run python2 manage.py runserver it is all fine. Did install django in my venv as mentioned in: Using Python 3 in virtualenv

Can someone push me to the right direction?

First check the version you're running by typing:

python -V

To get the python 2 version, then

python3 -V 

To get the python3 Version.

If you could post both versions, a screenshot of the full error, as well as the admin.py file in the app's directory it might help us help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM