Home » Python Web
  • 21
  • 05月

目前适合Python的云主机主要有2种类型:应用引擎(AppEngine),基于虚拟化技术的云主机。

下面就简单介绍一下~

[TOC]

一、应用引擎(AppEngine)

一般是资源独享型PaaS,支持PHP/JAVA/PYTHON/NODE.JS等多种编程语言,主要有以下3种:

他们的主要共同点:

  • 公用IP,出口IP有限,很多应用共用一个出口IP
  • 目前本身不提供备案服务,但一般都能绑定已备案的域名,可能会有一定风险
  • 使用SVN/GIT管理代码
  • 代码更新后,SAE自动重要部署,BAE和JAE需要手动重新部署
  • 费用相对比较低,按需付费
  • 一般会内置一些服务,比如云存储 …

Read More...

  • 16
  • 05月

本文主要介绍在JDAppEngine(JAE)云引擎中部署Flask应用程序的方法,JAE中的Python Web应用程序主要是使用Gunicorn来做代理的。

下面就跟着我来创建一个简单的Flask应用程序吧~~~

[TOC]

一、注册账号

访问http://jae.jd.com注册就可以了。

二、新建应用

开始新建应用:

JAE创建应用按钮

填写应用信息:

JAE填写应用信息

创建好之后,可以在列表中看到应用的基本信息:

JAE应用基本信息

说明:JAE使用GIT管理代码,下面的例子中,为了方便,是直接在网页上修改代码的。

新建的应用代码结构应该是下面这样的:

JAE Python应用文件列表

上面5个文件中,最主要的是Profilewsgi.pyrequirements.txt这3个文件:

  • Profile 是Gunicorn的配置文件
  • wsgi.py 是主程序文件
  • requirements.txt 主要是处理依赖关系

三、部署Flask应用程序

这个例子是使用bottle框架来做的,下面把我们把它改造成一个简单的Flask应用程序:

第一步,修改requirements …

Read More...

  • 09
  • 05月

flask开发常用插件收集

Read More...

  • 24
  • 01月

This is the fifteenth article in the series in which I document my experience writing web applications in Python using the Flask microframework.

The goal of the tutorial series is to develop a decently featured microblogging application that demonstrating total lack of originality I have decided to call microblog.

Here …

Read More...

  • 23
  • 01月

This is the fourteenth article in the series in which I document my experience writing web applications in Python using the Flask microframework.

The goal of the tutorial series is to develop a decently featured microblogging application that demonstrating total lack of originality I have decided to call microblog.

Here …

Read More...

  • 22
  • 01月

This is the thirteenth article in the series in which I document my experience writing web applications in Python using the Flask microframework.

The goal of the tutorial series is to develop a decently featured microblogging application that demonstrating total lack of originality I have decided to call microblog.

Here …

Read More...

  • 21
  • 01月

This is the twelfth article in the series in which I document my experience writing web applications in Python using the Flask microframework.

The goal of the tutorial series is to develop a decently featured microblogging application that demonstrating total lack of originality I have decided to call microblog.

Here …

Read More...

  • 19
  • 01月

This is the eleventh article in the series in which I document my experience writing web applications in Python using the Flask microframework.

The goal of the tutorial series is to develop a decently featured microblogging application that demonstrating total lack of originality I have decided to call microblog.

Here …

Read More...

  • 18
  • 01月

This is the tenth article in the series in which I document my experience writing web applications in Python using the Flask microframework.

The goal of the tutorial series is to develop a decently featured microblogging application that demonstrating total lack of originality I have decided to call microblog.

Here …

Read More...

  • 18
  • 01月

This is the ninth article in the series in which I document my experience writing web applications in Python using the Flask microframework.

The goal of the tutorial series is to develop a decently featured microblogging application that demonstrating total lack of originality I have decided to call microblog.

Here …

Read More...