浅谈Python之Django(三)
作者:z-victor 时间:2021-07-07 00:38:25
django-admin基本介绍
Django 提供了基于 web 的管理工具。
Django 自动管理工具是 django.contrib 的一部分。你可以在项目的 配置文件settings.py 中的INSTALLED_APPS 看到它
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'users',
'course',
'organization',
'operation'
激活django-admin
通常我们在生成项目时会在 urls.py 中自动设置好,我们只需去掉注释即可。
创建访问django-admin的超级用户
python manage.py createsuperuser
输入用户名
输入邮件
输入密码(至少8位数,不能纯数字)
确认密码
访问django-admin
启动:python manage.py runserver 0.0.0.0:8888
浏览器访问:127.0.0.1:8888/admin/
修改django-admin为中文
修改配置文件setting.py中的language_code为zh-hans
修改django-admin为中国时区
修改配置文件setting.py中的TIME_ZONE为Asia/Shanghai
USE_TZ 为False
后台放出users可以对用户信息进行修改
修改users目录下的admin.py文件
from django.contrib import admin
# Register your models here.
from .models import UserProfile
class UserProfileAdmin(admin.ModelAdmin):
pass
admin.site.register(UserProfile,UserProfileAdmin)
来源:https://blog.csdn.net/qq_28286687/article/details/105540141
标签:Python,Django
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
PHP 使用header函数设置HTTP头的示例解析 表头
2023-09-03 19:12:49
Python实现非正太分布的异常值检测方式
2021-11-22 12:27:57
![](https://img.aspxhome.com/file/2023/4/76054_0s.jpg)
Python检测网络延迟的代码
2023-03-26 08:36:31
itchat-python搭建微信机器人(附示例)
2022-05-04 00:00:54
Python中字典的基础介绍及常用操作总结
2022-11-30 14:33:40
![](https://img.aspxhome.com/file/2023/6/65056_0s.png)
Python报错:对象不存在此属性的解决
2023-05-30 20:12:56
![](https://img.aspxhome.com/file/2023/4/75254_0s.png)
Python日期时间Time模块实例详解
2023-11-07 07:26:34
Python实现的数据结构与算法之基本搜索详解
2021-07-25 03:47:44
![](https://img.aspxhome.com/file/2023/4/67934_0s.png)
Python实现删除列表中满足一定条件的元素示例
2023-11-07 14:38:39
深入理解ASP中FSO的神奇功能
2007-09-18 12:22:00
注册表单之死
2008-08-07 13:02:00
![](https://img.aspxhome.com/file/UploadPic/20088/7/20088713716694s.gif)
asp实现*号隐藏IP地址
2008-08-10 18:51:00
CSS Border使用小分享
2010-08-12 14:34:00
![](https://img.aspxhome.com/file/UploadPic/20108/12/box-model-47s.png)
Python中docx2txt库的使用说明
2022-03-23 18:58:46
WEB2.0网页制作标准教程(11)不用表格的菜单
2008-02-19 19:36:00
sqlserver数据库主键的生成方式小结(sqlserver,mysql)
2012-08-21 10:25:45
php中pcntl_fork创建子进程的方法实例
2023-11-15 02:28:21
![](https://img.aspxhome.com/file/2023/4/92824_0s.png)
ASP实现网站智能分词搜索
2007-10-18 13:50:00
PHP addslashes()函数讲解
2023-06-04 04:28:24
![](https://img.aspxhome.com/file/2023/0/55400_0s.png)
Javascript 获取css属性
2009-05-31 16:49:00