django(二)

1、创建一个管理员用户

[root@oracle86 mysite]# python3 manage.py createsuperuser
Username: admin
Email address: 2262096422@qq.com
Password: 
Password (again): 
Superuser created successfully.

2、启用开发服务器

python3 manage.py runserver 0.0.0.0:8000

3、访问

http://192.168.137.86:8000/admin

4、让poll应用在管理站点中可编辑

要告诉管理站点Question 对象要有一个管理界面。 要做这件事,需要打开polls/admin.py文件

from django.contrib import admin


from .models import Question

admin.site.register(Question)
原文地址:https://www.cnblogs.com/huanhuanang/p/5670326.html