django之创建第9个项目-管理后台admin
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的更多相关文章
- django之创建第10个项目-图片上传方式1
1.upload.HTMl <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang=& ...
- django之创建第12个项目-加载图片
百度云盘:django之创建第12个项目-加载图片 1.setting配置 #静态文件相关配置 # URL prefix for static files. # Example: "http ...
- django之创建第11个项目-页面整合
目的:将如下众多html页面整合到一个index.html页面中. 百度云盘:django之创建第11个项目-页面整合 用下面的方式实现: <!DOCTYPE html> <head ...
- django之创建第10-1个项目-图片上传并记录上传时间
1.百度云盘:django之创建第10-1个项目-图片上传并记录上传时间 2.主要修改的配置文件有3个,forms.views和models3个文件以及html 3.forms.py文件修改 #cod ...
- django之创建第8-3个项目-数据库数据提取之高级操作
1.配置test2.html <!DOCTYPE html> <html lang="en"> <head> <meta charset= ...
- django之创建第8-1个项目-数据库之增删改查/数据库数据显示在html页面
1.为test.DB数据库预先创建下面数据 1 张三 16 2015-01-02 12 李四 17 2015-01-04 13 王五 14 ...
- django之创建第8个项目-数据库配置及同步研究
1.sqlitestudio-2.1.5数据库可视化工具--百度云盘下载 2.编写C:\djangoweb\helloworld\blog\models.py文件 # Create your mode ...
- django之创建第7-4个项目-配置views文件实现url传值
即:怎么实现url?name=xiaodeng&age=28等类似传值处理 1.配置views文件 # Create your views here. #coding:utf-8 from d ...
- django之创建第7-3个项目-在站点blog下单独创建urls.py文件
1.在站点blog下单独创建urls.py文件 # -*- coding: UTF-8 -*- from django.conf.urls import patterns, include, url ...
随机推荐
- Generalized normal distribution and Skew normal distribution
Density Function The Generalized Gaussian density has the following form: where (rho) is the " ...
- PHP导出大数据
保存到本地 <?php // a db link for queries $lh = mysql_connect( '127.0.0.1', 'root', '' ); // and a con ...
- python的rsa公钥解密方法
示例: # -*- coding: UTF- -*- import M2Crypto import base64 #私钥加密,公钥解密 def pri_encrypt(msg, file_name): ...
- M2Crypto安装方法以及配置LDFLAGS、CFLAGS
python3.7+mac环境: $ brew install openssl && brew install swig $ brew --prefix openssl /usr/lo ...
- IDEA 快速将spring boot项目打包成jar包,简单快速有效
原文地址;https://blog.csdn.net/chen846262292/article/details/80701101 https://www.cnblogs.com/chrischen ...
- poj 2240 Arbitrage 题解
Arbitrage Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 21300 Accepted: 9079 Descri ...
- 【BZOJ】【4152】【AMPZZ2014】The Captain
最短路 题解:http://zyfzyf.is-programmer.com/posts/97953.html 按x坐标排序,相邻点之间连边.满足dist(x1,x3)<=dist(x1,x2) ...
- leetcode Roman Integer
class Solution { public: int romanToInt(string s) { if (s.length() < 1) return 0; map<char,int ...
- vRealize Automation的REST API Reference在哪里可以看到?
两个地方: 1. VMware官网可以查看. http://pubs.vmware.com/vrealize-automation-71/topic/com.vmware.vra.restapi.do ...
- memcached安装和验证
1> libevent安装 官网down: http://www.monkey.org 我的网盘down:http://pan.baidu.com/s/1qW8syZi [root@luozh ...