摘要: 1、service mysqld start 首先数据库是可用的2、rpm -qa |grep MySQL-python 这个包是存在的3、vim settings修改databases 加入mysql,库名,用户名之类的并将所创建的APP也加进去4、vim models.pyfrom django... 阅读全文
posted @ 2016-01-13 22:35 Lz阿飞 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 首先在模板下建一个index.html hello {{uname}}~ 1、from django.http import HttpResponse from django.template import loader, Context 导入要用的东西def index(req): t = loa... 阅读全文
posted @ 2016-01-13 17:51 Lz阿飞 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 1、第一个标签是 if 标签vim learn/home.html {{title}}{% if user %} name: {{user.name}} {%else%}用户不存在{%endif%}大体框架有 if else endif 组成if如果条件为真就执行其中内容,为假则执行else中内容i... 阅读全文
posted @ 2016-01-13 15:05 Lz阿飞 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1、vim learn/home.html {{title}}hello {{user}}花括号里加入的就是模板变量2、vim /learn/views.pydef home(request): return render(request,'home.html',{'title':'my page'... 阅读全文
posted @ 2016-01-13 14:22 Lz阿飞 阅读(389) 评论(0) 推荐(0) 编辑