Django入门指南-第10章:Django Admin 介绍(完结)
在浏览器中打开该URL:http://127.0.0.1:8000/admin/
我们可以检查一切是否正常,打开URL http://127.0.0.1:8000
我们首先创建一个管理员帐户:
python manage.py createsuperuser
按照说明操作:
Username (leave blank to use 'vitorfs'): larken
Email address: larken@example.com
Password:password123
Password (again):password123
Superuser created successfully.
# boards/admin.py from django.contrib import admin from .models import Board admin.site.register(Board)