09 2017 档案

摘要:#encoding:utf-8from django.shortcuts import render_to_responseimport hashlibfrom binascii import b2a_hex def GetData(request,key): ''' 获取GET与Post提交参数的 阅读全文
posted @ 2017-09-17 22:53 雪纷飞 阅读(1081) 评论(0) 推荐(0)
摘要:__author__ = 'Administrator'from django.utils.safestring import mark_safeclass Page: def __init__(self, current_page, data_count, per_page_count=10, p 阅读全文
posted @ 2017-09-17 22:51 雪纷飞 阅读(320) 评论(0) 推荐(0)
摘要:一:保证python运行环境安装 apt-get install python 如果需要进行开发则还要安装python-dev apt-get install python-dev 二:安装django 首先保证安装了pip包 利用pip进行django安装 pip install django 三 阅读全文
posted @ 2017-09-17 21:19 雪纷飞 阅读(426) 评论(0) 推荐(0)
摘要:1、Django请求的生命周期 武彦涛: 路由系统 -> 试图函数(获取模板+数据=》渲染) -> 字符串返回给用户 2、路由系统 王腾: /index/ -> 函数或类.as_view() /detail/(\d+) -> 函数(参数) 或 类.as_view()(参数) /detail/(?P< 阅读全文
posted @ 2017-09-11 20:48 雪纷飞 阅读(154) 评论(0) 推荐(0)
摘要:在meta 类中指定表名,在字段中通过db_column指定列名如下所示class Record(models.Model): content=models.CharField(max_length=32,db_column='record_content') class Meta: db_tabl 阅读全文
posted @ 2017-09-03 18:10 雪纷飞 阅读(4424) 评论(0) 推荐(0)