It's been a long time django 了 , Recently, I took over a new project and needed to install the corresponding package for the virtual environment , To configure xadmin There was a problem when I was , Make a note of
The first time I directly pip install xadmin
install , Many errors are reported when calling , Later, refer to relevant documents , Found to be xadmin Version problem , The solution is to go to Github Download the adapter above Django2
Version of , It is directly given here Download address
stay Pycharm
Create a new folder in the project root directory extra_apps
, Right click mark->Mark Directory as->Sources Root, Set as project resource file ,
Download the... In the compressed package xadmin
Unzip the folder into the project directory extra_apps
Folder , And in setting.py
Of INSTALL_APPS
add to xadmin
and scripy
, Here's the picture
urls.py
To configure xadmin Of import xadmin
urlpatterns = [
path('xadmin/', xadmin.site.urls),
]
The successful startup is as follows , Remember to create a super user login background
xadmin
It needs to be installed in a special way , Use pip
Mode installation can cause many errors .