- 下载xadmin源码 https://github.com/sshwsfc/xadmin/tree/django2
- 把源代码拷贝到Django项目根目录中
- 在settings的INSTALLED_APPS中添加 crispy_forms 和 xadmin
INSTALLED_APPS = [ 'crispy_forms', 'xadmin.apps.XAdminConfig', ]
- 项目urls.py
import xadmin urlpatterns = [ path('xadmin/', xadmin.site.urls), ]
- 安装xadmin的依赖包
django-crispy-forms django-import-export django-reversion django-formtools future httplib2 six xlwt xlsxwriter requests DjangoUeditor
- 在本项目的虚拟环境site-packages替换DjangoUeditor文件夹
- 通过migrate生成xadmin需要的表
migrate
7. 在项目urls.py中配置路由
import xadmin
urlpatterns = [
path('xadmin/', xadmin.site.urls),
]