上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 23 下一页
摘要: 题外话: 这里分享一个链接是将Flask 和 Apache 用 mod_wsgi 来进行传唤的部署方式,在digital ocean VPS 上的。https://www.digitalocean.com/community/articles/how-to-deploy-a-flask-application-on-an-ubuntu-vps挺不错的。但是对于tornado 来说,我们最好是采用tornado 和 nginx,因为“Tornado 对WSGI只提供了有限的支持,即使如此,因为 WSGI 并不支持非阻塞式的请求,所以如果你使用 WSGI 代替 Tornado 自己的 HTTP 服 阅读全文
posted @ 2014-02-17 15:23 spaceship9 阅读(748) 评论(0) 推荐(0) 编辑
摘要: 原文这里有显示地址:http://zhou123.blog.51cto.com/4355617/1312791现在摘取一部分:这里介绍一下python执行shell命令的四种方法:1、os模块中的os.system()这个函数来执行shell命令123>>> os.system('ls')anaconda-ks.cfg install.log install.log.syslog send_sms_service.py sms.py0注,这个方法得不到shell命令的输出。2、popen()#这个方法能得到命令执行后的结果是一个字符串,要自行处理才能得到想要的 阅读全文
posted @ 2014-02-13 09:26 spaceship9 阅读(1643) 评论(0) 推荐(0) 编辑
摘要: 在tornado 里面这样用看看logging.warning() , logging.info() , 我们非常想用 zdaemon , 和 logging 将对系统的所有访问转换到服务器里面,作为日志。让我们看看目录树。transaction.py 是tornado服务看一下 testpage1handler@require_basic_authclass TestPage1Handler(BaseHandler): """This is a test page to show the asker's utmost parent's all d 阅读全文
posted @ 2014-01-21 00:52 spaceship9 阅读(1539) 评论(0) 推荐(0) 编辑
摘要: 现在,我们用torndo做web开发框架,用他内部机制来处理HTTP请求。传说中的非阻塞式服务。整来整去,可谓之一波三折。可是,无论怎么样,算是被我做成功了。在tornado服务上,采用三种数据库模型--》1)torndb2)django model3)SQLAlchemy model 都同时输出相应的JSON,做API服务。(一个比一个强大的ORM model)都同时实现了一样的功能注意:要说明的一点是,在数据库建立模型的时候,是用到的django model建立的数据库模型。所以在使用torndb(SQL 操作语言的ORM) 和 django model的时候,非常简单操作,直接引用... 阅读全文
posted @ 2014-01-09 11:35 spaceship9 阅读(2488) 评论(0) 推荐(0) 编辑
摘要: django的模型from django.db import models""" A model pair to map car and its manufacturer"""class Manufacturer(models.Model): brand = models.CharField(max_length=100) location = models.CharField(max_length=100) def __unicode__(self): return self.brand class Meta: ordering = 阅读全文
posted @ 2013-12-19 23:39 spaceship9 阅读(716) 评论(0) 推荐(0) 编辑
摘要: django User model operationthis tutorial will guide us to know how to manipulate django User model.Read User object derived from databasefrom django.contrib.auth.models import User# Those two lines are different even if there is only one user 'admin' who registered beforeauser = User.objects 阅读全文
posted @ 2013-12-18 20:06 spaceship9 阅读(566) 评论(0) 推荐(0) 编辑
摘要: Here I got a very neat plugin for vim which is awesome indeed.It's from youtube years before.So let's check this out. :)http://www.youtube.com/watch?v=67OZNp9Z0CQ&noredirect=1you can download the reference tools here: https://github.com/klen/python-mode#how-to-installSomeone mentioned ab 阅读全文
posted @ 2013-12-17 10:46 spaceship9 阅读(306) 评论(0) 推荐(0) 编辑
摘要: Read by linux/GNU commandsLet's follow and start from here:http://django-tastypie.readthedocs.org/en/latest/tutorial.html#creating-resourcesAccording to tastypie's concept, Tastypie properly handles the Accept header.So we can use linux/GNU commands to do some fancy things!Bash script to get 阅读全文
posted @ 2013-12-14 17:06 spaceship9 阅读(546) 评论(0) 推荐(0) 编辑
摘要: tastypie is a good thing.Haven't test it thoroughly. Gonna need some provement.Now I will introduct how to use tastepie for newbies.Let me introduce all the equipments I have to deploy tastypie.1) linuxmint 132) virtualenv ( sudo apt-get install python-virtualenv )3) install django==1.5 in the v 阅读全文
posted @ 2013-12-14 15:06 spaceship9 阅读(526) 评论(0) 推荐(0) 编辑
摘要: Its one of the primary authors' lecture on pyCon: http://www.youtube.com/watch?v=Zv26xHYlc8s&noredirect=1What is Tastypie A REST framework for django Designed for extension Supports both Model & non-Model datafor more information, please visit http://tastypieapi.org1) make good use of HT 阅读全文
posted @ 2013-12-14 11:25 spaceship9 阅读(284) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 23 下一页