django之创建第9个项目-管理后台admin
2016-04-05 17:24
806 查看
django之创建第9个项目-管理后台admin配置
1、配置setting文件
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',#取消掉注释
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'blog',
)
2、配置C:\djangoweb\helloworld\helloworld\urls文件
# -*- coding: UTF-8 -*-
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('blog.views',
# Uncomment the admin/doc line below to enable admin documentation:
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),#取消掉注释
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),#取消掉注释
#url(r'^$', 'blog.views.index'),
url(r'^blog/', include("blog.urls")),#浏览器一旦访问blog就定位到blog.urls文件下的url地址
)
3、创建超级用户管理员
c:\djangoweb\helloworld>manage.py createsuperuser
Username (leave blank to use 'administrator'): xiaodeng#创建用户名
Email address:#不用创建则直接回车
Password:#输入密码,这里输入密码之后是看不到的,我默认输出了6个1
Password (again):
Superuser created successfully.
c:\djangoweb\helloworld>
4、启动服务器,c:\djangoweb\helloworld>manage.py runserver
5、打开网页,http://127.0.0.1:8000/admin/
6、登录
百度云盘:django之创建第9个项目-管理后台admin
1、配置setting文件
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',#取消掉注释
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'blog',
)
2、配置C:\djangoweb\helloworld\helloworld\urls文件
# -*- coding: UTF-8 -*-
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('blog.views',
# Uncomment the admin/doc line below to enable admin documentation:
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),#取消掉注释
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),#取消掉注释
#url(r'^$', 'blog.views.index'),
url(r'^blog/', include("blog.urls")),#浏览器一旦访问blog就定位到blog.urls文件下的url地址
)
3、创建超级用户管理员
c:\djangoweb\helloworld>manage.py createsuperuser
Username (leave blank to use 'administrator'): xiaodeng#创建用户名
Email address:#不用创建则直接回车
Password:#输入密码,这里输入密码之后是看不到的,我默认输出了6个1
Password (again):
Superuser created successfully.
c:\djangoweb\helloworld>
4、启动服务器,c:\djangoweb\helloworld>manage.py runserver
5、打开网页,http://127.0.0.1:8000/admin/
6、登录
百度云盘:django之创建第9个项目-管理后台admin
相关文章推荐
- Go语言核心之美 3.6-template模版
- golang的ssh包
- Django——Url相关
- log4go 源码剖析
- Google自己的下拉刷新组件 SwipeRefreshLayout + RecyclerView 实现 上拉刷新 和 下拉刷新
- MB1A MB1B MB1C MB11 MIGO的区别解析
- 两种生成带logo二维码的开发总结
- GoF——状态模式
- GoF——抽象工厂模式
- 六、go语言一些常用方法--go语言笔记
- 五、go语言特性--go语言笔记
- 四、golang类型讲解--go语言学习笔记
- 如何使用 Google Web Fonts?
- Go语言核心之美 3.5-JSON
- FaceNet--Google的人脸识别
- GoldenGate 基于日志的结构化数据复制备份软件
- Django model字段类型详解
- Exponential-time Algorithm
- Go语言开发环境配置
- Google推荐的图片加载库Glide介绍