In python3.4, django integrates the xadmin background method, djangoxadmin
Environment: window7 x64, python3.4, and django1.10
I. pip install xadmin Installation Error
1. the following error may be reported when you run the pip install xadmin command:
2. Solutions
Test-by-test
pip install git+git://github.com/sshwsfc/xadmin.git
Command can be used normally.
2. Configure xadmin in the django Project
Settings. py Configuration
INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'app.apps.AppConfig', 'xadmin', 'crispy_forms',]
Urls. py Configuration
urlpatterns = [ # url(r'^admin/', admin.site.urls), url(r'^xadmin/', xadmin.site.urls),]
Create adminx. py in the blog/directory and add the following content:
From. models import Permission, Article, Category, ArticleComment, Type, Notice, EmailVerifyRecordimport xadminimport xadmin. views as xviews class BaseSetting (object): enable_themes = True use_bootswatch = Truexadmin. site. register (xviews. baseAdminView, BaseSetting) class AdminSettings (object ): # Set base_site.html's Title site_title = 'management backend '# Set Footer site_footer = '2017 admin' menu_style = 'default' in base_site.html # Set def get_site_menu (self) in the menu ): return ({'title': 'Article management', 'perm': self. get_model_perm (Article, 'change'), 'menus': ({'title': 'Article', 'icon ': 'fa fa-vimeo-square', 'url ': self. get_model_url (Article, 'angelist')}, {'title': 'test category ', 'icon': 'fa fa-vimeo-square ', 'url': self. get_model_url (Category, 'angelist')}, {'title': 'Article category', 'icon ': 'fa fa-vimeo-square', 'url': self. get_model_url (Type, 'angelist')}, {'title': 'Post comments', 'icon ': 'fa fa-vimeo-square', 'url': self. get_model_url (ArticleComment, 'angelist')},)},) xadmin. site. register (xviews. commAdminView, AdminSettings)
After the configuration is complete, do not forget to run: python3 manage. py makemigrations, python3 manage. py migrate
Now, the basic configuration is complete. You can access http: // localhost: 8000/xadmin for normal use.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.