xadmin安装及运行

来源:5-2 xadmin的安装

weixin_慕斯卡4281563

2019-02-26

Package Version


defusedxml 0.5.0
diff-match-patch 20181111
Django 1.11
django-crispy-forms 1.7.2
django-formtools 2.1
django-import-export 1.2.0
django-reversion 3.0.3
et-xmlfile 1.0.1
future 0.17.1
httplib2 0.9.2
jdcal 1.4
mysqlclient 1.4.2.post1
odfpy 1.4.0
openpyxl 2.6.0
Pillow 5.4.1
pip 19.0.3
pytz 2018.9
PyYAML 3.13
setuptools 40.8.0
six 1.12.0
tablib 0.12.1
unicodecsv 0.14.1
wheel 0.33.1
xadmin 0.6.1
xlrd 1.2.0
xlwt 1.3.0

看5-2节前面部分视频同时跟着做xadmin的安装,折腾半天了最后还是不行。上面是我安装的包,python3.7 。从djnago2.1换成2.0换成1.11又换成2.1最后又换成现在的1.11,期间遇到很多大家都曾遇到的问题,终于在Pcharm中正常启动了服务器。
System check identified no issues (0 silenced).
February 26, 2019 - 17:59:54
Django version 1.11, using settings 'MxOline.settings’
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

当我在浏览器中输入http://127.0.0.1:8000/xadmin/
NameError at /xadmin/
name ‘reverse’ is not defined
Request Method: GET
Request URL: http://127.0.0.1:8000/xadmin/
Django Version: 1.11
Exception Type: NameError
Exception Value:
name ‘reverse’ is not defined
Exception Location: C:\Users\WenLiang\Envs\mxonline\lib\site-packages\xadmin\views\base.py in get_admin_url, line 140
Python Executable: C:\Users\WenLiang\Envs\mxonline\Scripts\python.exe
Python Version: 3.7.2
Python Path:
[‘C:\Users\WenLiang\PycharmProjects\MxOline\apps’,
‘C:\Users\WenLiang\PycharmProjects\MxOline’,
‘C:\Users\WenLiang\PycharmProjects\MxOline’,
‘C:\Users\WenLiang\PycharmProjects\MxOline\apps’,
‘C:\Users\WenLiang\Envs\mxonline\Scripts\python37.zip’,
‘C:\Users\WenLiang\Envs\mxonline\DLLs’,
‘C:\Users\WenLiang\Envs\mxonline\lib’,
‘C:\Users\WenLiang\Envs\mxonline\Scripts’,
‘c:\users\wenliang\appdata\local\programs\python\python37\Lib’,
‘c:\users\wenliang\appdata\local\programs\python\python37\DLLs’,
‘C:\Users\WenLiang\Envs\mxonline’,
‘C:\Users\WenLiang\Envs\mxonline\lib\site-packages’,
‘C:\Users\WenLiang\Envs\mxonline\lib\site-packages\xadmin-2.0.1-py3.7.egg’,
‘c:\users\wenliang\envs\mxonline\lib\site-packages’,
'C:\Program Files\JetBrains\PyCharm '
‘2018.3.4\helpers\pycharm_matplotlib_backend’,
‘C:\Users\WenLiang\Envs\mxonline\lib\site-packages\odf’,
‘C:\Users\WenLiang\Envs\mxonline\lib\site-packages\odf’,
‘C:\Users\WenLiang\Envs\mxonline\lib\site-packages\odf’,
‘C:\Users\WenLiang\Envs\mxonline\lib\site-packages\odf’,
‘C:\Users\WenLiang\Envs\mxonline\lib\site-packages\odf’,
‘C:\Users\WenLiang\Envs\mxonline\lib\site-packages\odf’,
‘C:\Users\WenLiang\Envs\mxonline\lib\site-packages\odf’]
Server time: 星期二, 26 二月 2019 17:59:56 +0800

这个问题不知怎么办?

写回答

1回答

weixin_慕斯卡4281563

提问者

2019-02-26

貌似解决了在C:\Users\WenLiang\Envs\mxonline\lib\site-packages\xadmin\views\base.py文件中把这句话不要注释掉from django.core.urlresolvers import reverse

我也忘记  什么时候我把这句给注释掉了 好像是因为曾经遇到个什么错误需要改这里。明天把今天折腾过程再复现一遍做个记录。

现在可以在浏览器中访问http://127.0.0.1:8000/xadmin/并使用bobby和密码登录了。

之前一直在用django2.1,从这节开始就要开始用1.11了,用2.0都不行





0
4
bobby
回复
weixin_慕斯卡4281563
442421039
2019-03-03
共4条回复

Python3.6+django+xadmin,打造在线教育平台

【毕设】Python 2.7到3.6 完美适配,Django升级2.0

3677 学习 · 4038 问题

查看课程