Django:无法导入名称 resolve_url
Django: cannot import name resolve_url
我在做 2nd part of django tutorial 的时候我在去 http://127.0.0.1:8000/admin/
:
之后得到了这个错误
ImportError at /admin/
cannot import name resolve_url
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.7.1
Exception Type: ImportError
Exception Value:
cannot import name resolve_url
Exception Location: /usr/local/lib/python2.7/dist-packages/django/contrib/auth/views.py in <module>, line 8
Python Executable: /usr/bin/python
Python Version: 2.7.6
Python Path:
['/home/xxx/Projects/mysite',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
Server time: Fri, 2 Jan 2015 22:44:47 +0000
我正在从事:
Ubuntu 14.04.1 LTS 64-bit
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
知道它是如何解决的吗?
这不是你的错,是Django安装不当造成的。
我的解决方案是转到 django 文件夹所在的位置。
这基本上是
/usr/local/lib/python2.7/dist-packages
从那里删除文件夹。
sudo rm -rf django
重新安装 Django
sudo pip install Django==1.7
或您想要的任何版本。
尽情享受吧!!!
我在做 2nd part of django tutorial 的时候我在去 http://127.0.0.1:8000/admin/
:
ImportError at /admin/
cannot import name resolve_url
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.7.1
Exception Type: ImportError
Exception Value:
cannot import name resolve_url
Exception Location: /usr/local/lib/python2.7/dist-packages/django/contrib/auth/views.py in <module>, line 8
Python Executable: /usr/bin/python
Python Version: 2.7.6
Python Path:
['/home/xxx/Projects/mysite',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
Server time: Fri, 2 Jan 2015 22:44:47 +0000
我正在从事:
Ubuntu 14.04.1 LTS 64-bit
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
知道它是如何解决的吗?
这不是你的错,是Django安装不当造成的。 我的解决方案是转到 django 文件夹所在的位置。 这基本上是
/usr/local/lib/python2.7/dist-packages
从那里删除文件夹。
sudo rm -rf django
重新安装 Django
sudo pip install Django==1.7
或您想要的任何版本。
尽情享受吧!!!