Using xadmin to override Django's admin

Install xadmin

pip install xadmin may report an error

pip install git+git://


To use after installation, you need to register three app s in setting



Modify the file in the root directory

import xadmin
from xadmin.plugins import xversion

urlpatterns = [
    url(r'^xadmin/', include(,

Then you need to create a new file to register your model

# -*- coding: utf-8 -*-
# from django.contrib import admin
import xadmin
from .models import *
from xadmin import views
# Register your models here.
class GlobalSettings(object):
    site_title = "Wellhotel Background management system"
    site_footer = "Wellhotel Background management system"
   menu_style = 'accordion'
class basesetting(object): 
= True
= True,GlobalSettings),basesetting)
The site "title in the global settings is the log in the upper left corner of xadmin, and the site" footer "is the log under xadmin. Menu? Style to set the left navigation bar to the type of click-down
basesetting is to open the theme system in the background. xadmin is off by default. After opening, you can select different themes.

Set the name of the app to Chinese. It's the app you created. Modify
# -*- coding: utf-8 -*-
from django.apps import AppConfig

class XprojectConfig(AppConfig):
    name = 'xproject'
    verbose_name = 'project'

Then modify it in

default_app_config = "xproject.apps.XprojectConfig"

Official document

Tags: Python git pip Django github

Posted on Tue, 03 Dec 2019 00:43:01 -0800 by buildernaut1