The Road to WeChat Mini Program Development (9) Django Admin Management Tool
Django provides web-based management tools.
The Django automated management tool is part of django.contrib. You can see it in the INSTALLED_APPS in the project's settings.py:
django.contrib is a huge set of functions, which is part of the basic Django code.
Activation management tool
Usually we will automatically set it in urls.py when generating the project, we only need to remove the comment.
The configuration items are as follows:
from django.conf.urls import url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
]
When all this is configured, the Django management tool is ready to run.
Start the development server, and then visit http://127.0.0.1:8000/admin/ in the browser to get the following interface:
You can create a super user through the command python manage.py createsuperuser, as shown below:
In order to let the admin interface manage a certain A data model, we need to register the data model to the admin first. For example, we have created the model Test in TestModel before. Modify TestModel/admin.py: After
refreshing, you can see the Testmodel data table: