Paste has been under development for a while, and has lots of code in it.

The code is largely decoupled except for some core functions shared by many parts of the code.

Those core functions are largely replaced in WebOb, and replaced with better implementations.

The future of these pieces is to split them into independent packages, and refactor the internal Paste dependencies to rely instead on WebOb.

paste.httpserver

# Use paste httpserver
from paste import httpserver
httpserver.serve(application, host='127.0.0.1', port=8000)

paste.deploy

murano-paste.ini is as follows.

[pipeline:murano]
pipeline = versionnegotiation faultwrap authtoken context rootapp [filter:context]
paste.filter_factory = murano.api.middleware.context:ContextMiddleware.factory #For more information see Auth-Token Middleware with Username and Password
#http://docs.openstack.org/developer/keystone/configuringservices.html
[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory [composite:rootapp]
use = egg:Paste#urlmap
/: apiversions
/v1: apiv1app [app:apiversions]
paste.app_factory = murano.api.versions:create_resource [app:apiv1app]
paste.app_factory = murano.api.v1.router:API.factory [filter:versionnegotiation]
paste.filter_factory = murano.api.middleware.version_negotiation:VersionNegotiationFilter.factory [filter:faultwrap]
paste.filter_factory = murano.api.middleware.fault:FaultWrapper.factory

(1) pipeline

[pipeline:murano]

pipeline = versionnegotiation faultwrap authtoken context rootapp

pipeline is used when you need apply a number of filters.

It takes one configuration key pipeline (plus any global configuration overrides you want).

pipeline is a list of filters ended by an application.

These filters are defined by the ini file.

rootapp is a Murano application.

(2) filter_factory

Filters are callables that take a WSGI application as the only argument, and return a “filtered” version of that application.

[filter:authtoken]

paste.filter_factory = keystonemiddleware.auth_token:filter_factory

For example, authtoken filter is implemented by keystonemiddleware.auth_token:filter_factory function.

Before visiting the Murano Application interface, filter_factory function will call the keystone client to check the user or tenant authorization.

(3) composite

[composite:rootapp]

use = egg:Paste#urlmap

/: apiversions

/v1: apiv1app

The default site directory is implemented by apiversions app.

The /v1 directory is implemented by apiv1app app.

(4) app_factory

[app:apiv1app]

paste.app_factory = murano.api.v1.router:API.factory

The application is the most common. You define one like:

def app_factory(global_config, **local_conf):
return wsgi_app

The global_config is a dictionary, and local configuration is passed as keyword arguments.

The function returns a WSGI application.

apiv1app is implemented by murano.api.v1.router:API.factory function.

WSGI学习系列Paste的更多相关文章

  1. WSGI学习系列多种方式创建WebServer

    def application(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) ...

  2. WSGI学习系列WebOb

    1. WSGI Server <-----> WSGI Middleware<-----> WSGI Application  1.1 WSGI Server wsgi ser ...

  3. WSGI学习系列WSME

    Introduction Web Services Made Easy (WSME) simplifies the writing of REST web services by providing ...

  4. WSGI学习系列eventlet.wsgi

    WSGI是Web Service Gateway Interface的缩写. WSGI标准在PEP(Python Enhancement Proposal)中定义并被许多框架实现,其中包括现广泛使用的 ...

  5. WSGI学习系列Pecan

    Pecan Introduce Pecan是一个轻量级的基于Python的Web框架, Pecan的目标并不是要成为一个“full stack”的框架, 因此Pecan本身不支持类似Session和D ...

  6. Docker学习系列(一):windows下安装docker(转载)

    本文目录如下: windows按照docker的基本要求 具体安装步骤 开始使用 安装远程连接工具连接docker 安装中遇到的问题 Docker的更新 Docker中的jupyter windows ...

  7. 分布式学习系列【dubbo入门实践】

    分布式学习系列[dubbo入门实践] dubbo架构 组成部分:provider,consumer,registry,monitor: provider,consumer注册,订阅类似于消息队列的注册 ...

  8. Entity Framework Code First学习系列目录

    Entity Framework Code First学习系列说明:开发环境为Visual Studio 2010 + Entity Framework 5.0+MS SQL Server 2012, ...

  9. WCF学习系列汇总

    最近在学习WCF,打算把一整个系列的文章都”写“出来,包括理论和实践,这里的“写”是翻译,是国外的大牛写好的,我只是搬运工外加翻译.翻译的不好,大家请指正,谢谢了.如果觉得不错的话,也可以给我点赞,这 ...

随机推荐

  1. CodeForces 404D Minesweeper 1D (DP)

    题意:给定一个序列,*表示雷,1表示它旁边有一个雷,2表示它旁边有两个雷,0表示旁边没有雷,?表示未知,求有多少情况. 析:dp[i][j] 表示第 i 个放 j 状态,有多少种情况,然后很简单的DP ...

  2. jquery文件上传控件 Uploadify 可以和ajax交互

    http://www.cnblogs.com/mofish/archive/2012/11/30/2796698.html  原网址 基于jquery的文件上传控件,支持ajax无刷新上传,多个文件同 ...

  3. sonar Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar

    背景: 今天在项目根目录执行maven sonar:sonar ,报错信息如下,然后就各种的搜,折腾了多半天天也没找出解决办法,最后打算放弃时,看到一遍文章说是mysql  max_allowed_p ...

  4. Django之后台管理二

    前面讲到admin界面用户的注册以及修改,如果我们注册的用户密码忘记了该怎么办呢 在终端输入如下的命令进行重置 D:\django_test2>python manage.py shell Py ...

  5. doges

    dogse入门指南 Dogse作为游戏服务端引擎,目前只包含游戏服务端的核心部分,但这也是最核心的部分.它全部使用.net c#开发,充分兼顾了程序性能与代码编写的准确性与易用性,再加上以vs作为开发 ...

  6. Angular2使用ng2-file-upload上传文件

    Angular2中有两个比较好用的上传文件的第三方库,一个是ng2-file-upload,一个是ng2-uploader.ng2-uploader是一个轻便的上传文件的支持库,功能较弱,而ng2-f ...

  7. dorado中的视图实现类和监听器

    视图模型实现类(DefaultViewModel.java)的主要功能:  1. Dataset的初始化以及数据导入  2. 各种View组件的初始化工作 DefaultViewModel也是动态创建 ...

  8. C++基础学习6:内联函数

    C++语言新增关键字 inline,用于将一个函数声明为内联函数.在程序编译时,编译器会将内联函数调用处用函数体替换,这一点类似于C语言中的宏扩展. 采用内联函数可以有效避免函数调用的开销,程序执行效 ...

  9. 小B的询问 莫队分块

    题目描述 小B有一个序列,包含N个1~K之间的整数.他一共有M个询问,每个询问给定一个区间[L..R],求Sigma(c(i)^2)的值,其中i的值从1到K,其中c(i)表示数字i在[L..R]中的重 ...

  10. Hash Join是Oracle CBO时代经常出现的一种连接方式

    Hash Join是Oracle CBO时代经常出现的一种连接方式,对海量数据处理时经常出现在执行计划里.本篇的上篇(http://space.itpub.net/17203031/viewspace ...