摘要: render_to_response() 的第一个参数必须是要使用的模板名称。 如果要给定第二个参数,那么该参数必须是为该模板创建 Context 时所使用的字典。 如果不提供第二个参数, render_to_response() 使用一个空字典。 阅读全文
posted @ 2015-10-22 21:06 gopher-lin 阅读(134) 评论(0) 推荐(0) 编辑
摘要: import urllib2import cookielibcookie = cookielib.CookieJar()handler=urllib2.HTTPCookieProcessor(cookie)opener = urllib2.build_opener(handler)response ... 阅读全文
posted @ 2015-10-22 20:47 gopher-lin 阅读(179) 评论(0) 推荐(0) 编辑
摘要: ublime Text 新建文件的模版插件: SublimeTmpl 阅读全文
posted @ 2015-10-22 19:19 gopher-lin 阅读(106) 评论(0) 推荐(0) 编辑
摘要: # def mylogin(request):# if request.method == 'POST': # 当提交表单时# form = LoginForm(request.POST) # form 包含提交的数据# if form.is_valid(... 阅读全文
posted @ 2015-10-22 14:54 gopher-lin 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 会话(Session)跟踪是Web程序中常用的技术,用来跟踪用户的整个会话。常用的会话跟踪技术是Cookie与Session。Cookie通过在客户端记录信息确定用户身份,Session通过在服务器端记录信息确定用户身份。本章将系统地讲述Cookie与Session机制,并比较说明什么时候不能用Co... 阅读全文
posted @ 2015-10-22 12:43 gopher-lin 阅读(194) 评论(0) 推荐(0) 编辑
摘要: Python+Apache+django配置Python2.7 https://www.python.org/downloads/release/python-2710/Apache2.2 : http://www.apachehaus.com/cgi-bin/download.plxDjango1... 阅读全文
posted @ 2015-10-22 09:44 gopher-lin 阅读(593) 评论(0) 推荐(0) 编辑
摘要: 在setting.py 家FILE_CHARSET='gb18030'DEFAULT_CHARSET='utf-8' 阅读全文
posted @ 2015-10-21 15:04 gopher-lin 阅读(159) 评论(0) 推荐(0) 编辑
摘要: person_list = [] my_list = [] c=[] for i in Me.objects.filter(changdi=1): person_list.append([i.time]) for arry in person_list: my_list.extend(arry) v... 阅读全文
posted @ 2015-10-21 10:56 gopher-lin 阅读(785) 评论(0) 推荐(0) 编辑
摘要: {% extends 'base.html' %}{% block title %}环境监控{% endblock title %}{% block extracss %} {% load staticfiles %} {% endblock extracss %}{% ... 阅读全文
posted @ 2015-10-19 16:40 gopher-lin 阅读(166) 评论(0) 推荐(0) 编辑
摘要: {% extends 'base.html' %}{% block title %}环境监控{% endblock title %}{% block extracss %} {% load staticfiles %} {% endblock extracss %... 阅读全文
posted @ 2015-10-19 13:03 gopher-lin 阅读(1024) 评论(0) 推荐(1) 编辑