django之创建第7个项目-url配置】的更多相关文章

1.urls.PY分离 # -*- 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', # Examples: # url(r…
1.配置urls.py 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('', # Uncomment the admin/doc line below to enable admin d…
修改urls.PY文件 # -*- 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 adm…
1.sqlitestudio-2.1.5数据库可视化工具--百度云盘下载 2.编写C:\djangoweb\helloworld\blog\models.py文件 # Create your models here. #coding:utf-8 from django.db import models class Student(models.Model): name=models.CharField(max_length=50) age=models.IntegerField() 3.配置C:…
即:怎么实现url?name=xiaodeng&age=28等类似传值处理 1.配置views文件 # Create your views here. #coding:utf-8 from django.http import HttpResponse import datetime #导入templates文件所需导入库 from django.template import loader,Context class Person(): def __init__(self,name,age,s…
百度云盘:django之创建第12个项目-加载图片 1.setting配置 #静态文件相关配置 # URL prefix for static files. # Example: "http://example.com/static/", "http://static.example.com/" STATIC_URL = '/static/' import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)…
目的:将如下众多html页面整合到一个index.html页面中. 百度云盘:django之创建第11个项目-页面整合 用下面的方式实现: <!DOCTYPE html> <head> <meta charset="UTF-8"> <title>站点主页</title> <!--去掉超链接中的下划线--> <style>a{TEXT-DECORATION:none}</style> <…
1.百度云盘:django之创建第10-1个项目-图片上传并记录上传时间 2.主要修改的配置文件有3个,forms.views和models3个文件以及html 3.forms.py文件修改 #coding:utf-8 #这里定义html页面中用到的表单,常和views和models文件配合使用 """ >>> help(django) Help on package django: PACKAGE CONTENTS conf (package) contr…
1.upload.HTMl <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>图片上传功能</titl…
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',    # Uncomm…