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. Nor Flash工作原理

    http://blog.chinaunix.net/uid-26876150-id-3723678.html Nor Flash 具有像内存一样的接口,它可以像内存一样读,却不可以像内存一样写,Nor ...

  2. python 根据字典中的key,value进行排序

    #coding=utf-8 import requests,json,collections,base64,datetime def sort(datas): data=json.dumps(data ...

  3. Web信息架构:设计大型网站(第3版) [美]Peter Morville 中文PDF扫描版

    新版Web信息架构设计大型网站针对新技术做了全面更新——搭配新颖范例.全新场景及最佳实践信息——但是,其焦点依然放在基础原理上.其结构严谨,图文并貌,内容涵盖了信息架构基本原理和实践应用的方方面面. ...

  4. 水平居中的那些事之解决jqpagination分页插件无法居中的问题

    固定宽度的元素水平居中只需要 margin-left:auto: margin-right:auto; 换成 margin:0 auto; 也是一样的 今天给我用的jqPagination分页插件实现 ...

  5. Wannafly挑战赛28B(DP,思维,字符串)

    #include<bits/stdc++.h>using namespace std;int n;int nxt[3][100007];char buff[100007];const ch ...

  6. 使用js实现水波效果

    使用到的工具:jQuery Ripples Plugin 下载安装 git clone https://github.com/sirxemic/jquery.ripples.git 引入jquery, ...

  7. php 顺序线性表

    <?php /* * 线性顺序表 ,其是按照顺序在内存进行存储,出起始和结尾以外都是一一连接的(一般都是用一维数组的形式表现) * * GetElem: 返回线性表中第$index个数据元素 * ...

  8. [USACO5.4]奶牛的电信Telecowmunication 最小割

    题目描述 农夫约翰的奶牛们喜欢通过电邮保持联系,于是她们建立了一个奶牛电脑网络,以便互相交流.这些机器用如下的方式发送电邮:如果存在一个由c台电脑组成的序列a1,a2,...,a(c),且a1与a2相 ...

  9. php暂停函数sleep()和usleep的区别

    在PHP中暂停代码执行一定时间,有两个函数可以实现,一个是sleep(),另一个是usleep(),它们参数都是一个整数值.sleep()是暂停多少秒,usleep()是暂停多少微秒. 注意:usle ...

  10. spring 配置 junit

    package cn.hefen.mall.app; import cn.hefen.mall.app.model.ResultMap; import cn.hefen.mall.app.model. ...