要在admin内显示的表,在admin中进行注册,然后在登录admin后台,才可以对表进行操作
例如:
from django.contrib import admin
from app01 import models
# Register your models here.
admin.site.register(models.Book)
在django的admin创建登录用户:
$ python manage.py createsuperuser
Username (leave blank to use 'administrator'): jinxf
Email address:
Password:
Password (again):
This password is too short. It must contain at least 8 characters.
This password is too common.
This password is entirely numeric.
Password:
Password (again):
Error: Blank passwords aren't allowed.
Password:
Password (again):
Superuser created successfully.