Other articles


  1. Speedup scons over your small project

    TL;DR

    In your SConstruct file, add the tools keyword argument to Environment and DefaultEnvironment initialization to explicitly specify the tools needed in your project. It saves a lot of time.

    The Story

    My resume was written in LaTeX and convert to PDF using a handwritten Makefile, of which I ...

    read more

    There are comments.

  2. 在虚拟主机上运行Flask-Twip

    关于Flask-Twip的介绍请参考前一篇文章

    Flask-Twip支持在普通的虚拟主机上运行,通过虚拟主机的CGI界面运行。

    什么是CGI

    CGI界面(Common Gateway Interface)是在每次HTTP请求时,由HTTP server调用一个脚本,在调用脚本时将客户的HTTP request headers信息放在环境变量中,然后将脚本到stdout的输出当作HTTP response返回给客户端。

    每个HTTP请求都会进行一次fork操作,CGI脚本的性能非常糟糕。不过对API proxy来说足够了。

    如何在普通虚拟主机上搭建Flask-Twip

    要在虚拟主机上搭建Flask-Twip,需要虚拟主机提供了SSH访问以方便搭建环境。

    准备工作:安装Python

    Flask-TwipFlask框架的一个扩展,Flask本身已经支持Python3,但是它依赖的werkzeug目前最高仅支持Python2.7。为了方便未来支持Python3,Flask-Twip本身仅支持Python2.7。

    首先判断Python版本:ssh ...

    read more

    There are comments.

  3. Flask-Twip

    Flask,拿twip练手。项目叫Flask-Twip

    项目主页: https://github.com/yegle/flask_twip/

    原来twip是Twitter API Proxy in PHP,现在仍然叫twip是因为现在是Twitter API Proxy in Python。当然未来也不排除蛋疼写个RubyNode.js版,所以twip还是当作Twitter API Proxy来解释比较好。

    Flask-Twip作为Flask的extension存在,与twip类似使用MPL 1.1开源。

    目前支持原来的O模式,T模式还在测试尚未release ...

    read more

    There are comments.

  4. Flask与`unicode_literals`

    最近在写Flask,遇到一个诡异的问题

    Traceback (most recent call last):
      File "/Users/yegle/git/apkay/apkay-venv/lib/python2.7/site-packages/flask/app.py", line 1701, in __call__
        return self.wsgi_app(environ, start_response)
      File "/Users/yegle/git/apkay/apkay-venv/lib/python2.7/site-packages/flask/app.py", line 1685, in wsgi_app
        with self.request_context ...
    read more

    There are comments.

Page 1 / 1

blogroll

social