我测试了一下,并没有出现错误,测试步骤
1. 新建一个 python3.6 环境
2. source env/bin/activate
3. pip install django //安装的是 Django-2.0.2
4. pip install git+git://
github.com/sshwsfc/xadmin.git@django2 #看的 github 主页上 2.0 需要这样安装
5. django-admin startproject testpro
6. 修改 testpro/
settings.py ,添加三行
···
'xadmin',
'crispy_forms',
'reversion',
···
7. 修改 testpro/
urls.py ,如下
···
from django.contrib import admin
from django.urls import path
import xadmin
xadmin.autodiscover()
from xadmin.plugins import xversion
xversion.register_models()
urlpatterns = [
path('xadmin/', xadmin.site.urls),
]
···
8. ./
manage.py migrate
9. ./
manage.py createsupersuer
10. ./
manage.py runserver
运行 ok
https://i.loli.net/2018/02/12/5a81aeacd47a2.png参考网页:
https://github.com/sshwsfc/xadminhttp://xadmin.readthedocs.io/en/docs-chinese/quickstart.html#id1我是新手,只能这样用笨办法帮你了 :)