Skip to main content

YAML configurator for Flask app

Project description

Usage:

from flaskext.yamlconfig import install_yaml_config
install_yaml_config(app)
app.config.from_yaml(app, "main.yaml")

or

from flaskext.yamlconfig import install_yaml_config
from flaskext.yamlconfig import AppYAMLConfigure

class MyConfig(AppYAMLConfigure):
    def configure_mysection(self, content):
        for item in content:
            ....

install_yaml_config(app, MyConfig)
app.config.from_yaml(app, "main.yaml")

Config file sample:

blog_edit:
    view: !!python/name:views.blog.edit_blog
    url: /blog/edit/<blog_url>
    renderer: actions/blog/edit.html
    methods:
        - GET
        - POST
    context:
        w_group: empty

ajaxBlogJoin:
    view: !!python/name:views.blog.ajax_blog_join
    url: /ajax/blogjoin/<int:blog_id>
    methods:
        - POST
    renderer: json

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-YAMLConfig-0.0.1.zip (5.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page