DjangoTrails03Admin页面

首选创建超级管理员

(venv) williamtekiMacBook-Pro:youyu valentine$ python manage.py createsuperuser
用户名 (leave blank to use 'valentine'): yourwilliam
电子邮件地址: [email protected]
Password: 
Password (again): 
Superuser created successfully.

启动服务器并访问

使用python manage.py runserver启动服务器

访问 http://127.0.0.1:8000/admin/ 访问管理控制台

-w1280

添加Article 页面

编辑 blog/admin.py文件

from django.contrib import admin

# Register your models here.
from .models import Article

admin.site.register(Article)

试试添加一个Article对象

Last updated

Was this helpful?