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:…
1.配置test2.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <li>获取单个数据</li> <li>ID:{{student.id}}---name:{{student.…
1.为test.DB数据库预先创建下面数据 1    张三    16    2015-01-02    12    李四    17    2015-01-04    13    王五    14    2015-04-24    0 2.配置C:\djangoweb\helloworld\blog\urls.py文件 # -*- coding: UTF-8 -*- from django.conf.urls import patterns, include, url urlpatterns…
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…
"""1)age__gt = 16等价于age > 162)age = 163)age__gte = 16等价于age >= 164)name__contains="张" 等价于 like "%张%"5)__exact 精确等于 like "xxx"6)__iexact 精确等于,忽略大小写 ilike "xxx"7)__lt 小于8)__lte 小于等于9)__in 存在于一个lis…
修改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…
目的:将如下众多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…