Django Admin模块是什么
1.Django的后台管理工具
2.读取定义的模型元数据,提供强大的管理使用页面
为什么需要Django Admin模块
1.Django Shell新增文章太复杂了
2.管理页面是基础设施中得要的部分
3.认证用户、显示管理模型、校验输入等功能类似
创建admin用户
(base) D:\git\django\demo>python manage.py createsuperuser
Username (leave blank to use 'sandwich'): sandwich
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.
Bypass password validation and create user anyway? [y/N]: y
Superuser created successfully.
(base) D:\git\django\demo>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
March 13, 2021 - 22:48:01
Django version 3.1.5, using settings 'demo.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
然后打开http://127.0.0.1:8000 就可以用上面创建的admin账户登录了