05 2014 档案

6,视图和路由
摘要:REST framework includes an abstraction for dealing with ViewSets, that allows the developer to concentrate on modeling the state and interactions of t... 阅读全文

posted @ 2014-05-29 13:23 数学之道 阅读(274) 评论(0) 推荐(0)

5,基于关系和超链接的 API
摘要:Tutorial 5: Relationships & Hyperlinked APIsAt the moment relationships within our API are represented by using primary keys. In this part of the tuto... 阅读全文

posted @ 2014-05-29 11:31 数学之道 阅读(696) 评论(0) 推荐(0)

4,认证和授权
摘要:Currently our API doesn't have any restrictions on who can edit or delete code snippets. We'd like to have some more advanced behavior in order to mak... 阅读全文

posted @ 2014-05-28 14:10 数学之道 阅读(368) 评论(0) 推荐(0)

3,基于类的视图函数
摘要:We can also write our API views using class based views, rather than function based views. As we'll see this is a powerful pattern that allows us to r... 阅读全文

posted @ 2014-05-27 16:12 数学之道 阅读(349) 评论(0) 推荐(0)

2,请求和响应
摘要:From this point we're going to really start covering the core of REST framework. Let's introduce a couple of essential building blocks.从现在起,我们将开始接触 RE... 阅读全文

posted @ 2014-05-27 15:35 数学之道 阅读(428) 评论(0) 推荐(0)

1,序列化
摘要:介绍该教程将会让你理解 REST 框架的各个组件是怎么工作的。该教程很深入,你可能需要取饼干和你喜欢的饮料。如果你想快速的浏览,你应该去看 quickstart 。注意:该教程对应的代码可以去GitHub看, tomchristie/rest-framework-tutorial 。完整的实现作为测... 阅读全文

posted @ 2014-05-27 13:40 数学之道 阅读(607) 评论(0) 推荐(0)

0,快速教程
摘要:QuickstartWe're going to create a simple API to allow admin users to view and edit the users and groups in the system.我们将建立一个简单的API例子,只有超级用户admin才能查看和... 阅读全文

posted @ 2014-05-27 10:40 数学之道 阅读(310) 评论(0) 推荐(0)

如何卸载Python通过setup.py安装的模块
摘要:0,pip uninstall xxxx1、找到eggsudo easy_install -m BitVector....Using /usr/local/lib/python2.6/dis2、删除egg文件和py、pyc1 cd /usr/local/lib/python2.6/dist-pack... 阅读全文

posted @ 2014-05-26 16:36 数学之道 阅读(539) 评论(0) 推荐(0)

Django ImageField 上传图片并保存到数据库
摘要:转自:http://logic0.blog.163.com/blog/static/188928146201371235435974/Form代码:class ImageUploadForm(forms.Form): """Image upload form.""" image = fo... 阅读全文

posted @ 2014-05-25 12:25 数学之道 阅读(2705) 评论(0) 推荐(0)

Django 登录页面重定向
摘要:转自:http://blog.chedushi.com/archives/3484登陆和注销操作在网页编程上很常见,这两个操作经常需要在操作成功以后转入发出请求的页面。比如用户正在浏览一篇文章,发现下载该文章的附件需要登录才能进行,这时候点击登陆链接转入登陆页面,输入用户名密码登陆成功以后,会自动转... 阅读全文

posted @ 2014-05-20 14:04 数学之道 阅读(4010) 评论(0) 推荐(0)

python 调试命令
摘要:部分整理自:http://flysnowxf.iteye.com/blog/1327677启动调试:python -m pdb xxx.py常用命令说明:l #查看运行到哪行代码n #单步运行,跳过函数s #单步运行,可进入函数p 变量 #查看变量值b 行... 阅读全文

posted @ 2014-05-05 15:38 数学之道 阅读(310) 评论(0) 推荐(0)

导航