django framework learning: twenty-six. django xadmin management background registry information

Foreword

If you want to add, delete or modify the contents of the table in the xadmin background, just write the registry information in the previous admin.py file, you need to create a new adminx.py file in the same level directory as admin.py.
Then control the content to be displayed on the adminx.py file control page.

models module

We used the previous Person form as before, and the form design is as follows:

 

 Registry information

Create adminx.py file in the project directory, register the Person table information to the management background

 

 Terminal start django service: python manage.py runserver 0.0.0.0:8000

Browser input: ip: 8000 / xadmin /, the upper left side shows that the Person table has been registered to the background management page, click to display the information as follows:

 

 Click the add button in the upper right corner to add users to the database table information.

 

According to the actual needs, the table can be exported in the required format

 

Guess you like

Origin www.cnblogs.com/liushui0306/p/12699014.html