Git Product home page Git Product logo

plaster_pastedeploy's Introduction

plaster_pastedeploy

main CI Status

plaster_pastedeploy is a plaster plugin that provides a plaster.Loader that can parse ini files according to the standard set by PasteDeploy. It supports the wsgi plaster protocol, implementing the plaster.protocols.IWSGIProtocol interface.

Usage

Applications should use plaster_pastedeploy to load settings from named sections in a configuration source (usually a file).

  • Please look at the documentation for plaster on how to integrate this loader into your application.
  • Please look at the documentation for PasteDeploy on the specifics of the supported INI file format.

Most applications will want to use plaster.get_loader(uri, protocols=['wsgi']) to get this loader. It then exposes get_wsgi_app, get_wsgi_app_settings, get_wsgi_filter and get_wsgi_server.

import plaster

loader = plaster.get_loader('development.ini', protocols=['wsgi'])
# to get any section out of the config file
settings = loader.get_settings('app:main')

# to get settings for a WSGI app
app_config = loader.get_wsgi_app_settings()  # defaults to main

# to get an actual WSGI app
app = loader.get_wsgi_app()  # defaults to main

# to get a filter and compose it with an app
filter = loader.get_wsgi_filter('filt')
app = filter(app)

# to get a WSGI server
server = loader.get_wsgi_server()  # defaults to main

# to start the WSGI server
server(app)

Any plaster.PlasterURL options are forwarded as defaults to the loader. Some examples are below:

  • development.ini#myapp
  • development.ini?http_port=8080#main
  • pastedeploy+ini:///path/to/development.ini
  • pastedeploy+ini://development.ini#foo
  • egg:MyApp?debug=false#foo

plaster_pastedeploy's People

Contributors

mmerickel avatar huntcsg avatar dependabot[bot] avatar dairiki avatar kpinc avatar stevepiercy avatar digitalresistor avatar onovy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.