随笔分类 -  Django

python 学习
摘要:def login(request): if request.method == 'POST': uf = LoginForm(request.POST) if uf.is_valid(): #获取表单用户密码 usern... 阅读全文
posted @ 2015-10-25 12:14 gopher-lin 阅读(3889) 评论(0) 推荐(0)
摘要:如果用户没有登陆,重定向到settings.LOGIN_URL(把在查询字符串中的当前绝对路径传参过去,例如 /accounts/login/?next=/polls/3/ 如果用户已经登陆,正常执行视图函数默认情况下,用户在成功认证后的重定向路径被存在查询字符串中的next参数中,如果你想修改的... 阅读全文
posted @ 2015-10-23 11:30 gopher-lin 阅读(214) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/yelbosh/article/details/7545335 阅读全文
posted @ 2015-10-23 08:07 gopher-lin 阅读(101) 评论(0) 推荐(0)
摘要:http://www.cnblogs.com/btchenguang/archive/2012/09/01/2666763.html 阅读全文
posted @ 2015-10-22 21:23 gopher-lin 阅读(255) 评论(0) 推荐(0)
摘要:render_to_response() 的第一个参数必须是要使用的模板名称。 如果要给定第二个参数,那么该参数必须是为该模板创建 Context 时所使用的字典。 如果不提供第二个参数, render_to_response() 使用一个空字典。 阅读全文
posted @ 2015-10-22 21:06 gopher-lin 阅读(146) 评论(0) 推荐(0)
摘要:Alt+Enter 自动添加包Ctrl+t SVN更新Ctrl+k SVN提交Ctrl + / 注释(取消注释)选择的行Ctrl+Shift+F 高级查找Ctrl+Enter 补全Shift + Enter 开始新行TAB Shift+TAB 缩进/取消缩进所选择的行Ctrl + Alt + I 自... 阅读全文
posted @ 2015-09-25 21:28 gopher-lin 阅读(212) 评论(0) 推荐(0)
摘要:我有两个模板,base.html和index.html,index.html继承自base.html,css文件放在root/static/css目录下。为了在index.html中引入另外一个CSS文件,我在base.html中加入了一个{% block extracss %}{% endbloc... 阅读全文
posted @ 2015-09-24 10:16 gopher-lin 阅读(657) 评论(0) 推荐(0)