摘要: 转载自:http://www.django-rest-framework.org/tutorial/1-serialization/#tutorial-1-serialization Tutorial 1: Serialization Introduction This tutorial will 阅读全文
posted @ 2017-12-09 12:58 极光天际 阅读(252) 评论(0) 推荐(0)
摘要: 教程 1 - Serialization 2 - Requests & Responses 3 - Class-based views 4 - Authentication & permissions 5 - Relationships & hyperlinked APIs 6 - Viewsets 阅读全文
posted @ 2017-12-09 12:57 极光天际 阅读(157) 评论(0) 推荐(0)
摘要: 首先 angular4 和django 1.11.1交互 有跨域问题 所以先关闭cors 和csrf验证 一.解决跨域问题 cors github django-cors-headers 1)安装corsheaders 1 pip install django-cors-headers 1 pip 阅读全文
posted @ 2017-12-09 12:33 极光天际 阅读(2318) 评论(0) 推荐(0)
摘要: PhantomJS(爬取动态页面需要用到) 基于webkit的javaScript API。提供了css选择器,提供了处理文件的I/O操作,支持Web标准、DOM操作、JSON、HTML5、Canvas、SVG。 mac安装配置: 1. http://phantomjs.org/download.h 阅读全文
posted @ 2017-12-08 15:22 极光天际 阅读(1129) 评论(0) 推荐(0)
摘要: 概述# 原稿地址:使用 2to3 将代码移植到 Python 3 几乎所有的Python 2程序都需要一些修改才能正常地运行在Python 3的环境下。为了简化这个转换过程,Python 3自带了一个叫做2to3的实用脚本(Utility Script),这个脚本会将你的Python 2程序源文件作 阅读全文
posted @ 2017-12-06 19:55 极光天际 阅读(5226) 评论(0) 推荐(0)
摘要: 在终端上输入pydoc会显示以下信息 pydoc - the Python documentation tool pydoc <name> ... Show text documentation on something. <name> may be the name of a Python key 阅读全文
posted @ 2017-12-06 13:30 极光天际 阅读(19105) 评论(0) 推荐(0)
摘要: raw_input的功能是方便的从控制台读入数据。 input与raw_input都是Python的内建函数,实现与用户的交互,但是功能不同。 一、raw_input 下面介绍让raw_input的几种功能。 1、输入字符串 1>>> raw_input_A = raw_input("raw_inp 阅读全文
posted @ 2017-12-06 13:18 极光天际 阅读(1389) 评论(0) 推荐(0)
摘要: print ("So, you're 5r old, %r tall and %r heavy." % (age, height, weight)) print ("So, you're %r old, %r tall and %r heavy." % (age, height, weight))说 阅读全文
posted @ 2017-12-06 13:16 极光天际 阅读(1566) 评论(0) 推荐(0)
摘要: 问题 print "www.baidu.com" Python2 print ("www.baidu.com") Python3 出现 SyntaxError: Missing parentheses in call to 'print' 原因:Mac安装俩个python版本,2和3,python2 阅读全文
posted @ 2017-12-06 11:10 极光天际 阅读(804) 评论(0) 推荐(0)
摘要: 谁会成为AI 和大数据时代的第一开发语言? 这本已是一个不需要争论的问题。如果说三年前,Matlab、Scala、R、Java 和 Python还各有机会,局面尚且不清楚,那么三年之后,趋势已经非常明确了,特别是前两天 Facebook 开源PyTorch 之后,Python 作为 AI 时代头牌语 阅读全文
posted @ 2017-12-06 08:57 极光天际 阅读(33159) 评论(4) 推荐(3)