YAML configurator for Flask app.
Project description
Flask-YAMLConfig
----------------
Usage:
::
from flaskext.yamlconfig import install_yaml_config
yaml_config = install_yaml_config(app)
yaml_config("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:
....
yaml_config = install_yaml_config(app, MyConfig)
yaml_config("main.yaml")
Config file sample:
::
blog_edit:
view: views.blog.edit_blog
url: /blog/edit/<blog_url>
renderer: actions/blog/edit.html
methods:
- GET
- POST
context:
w_group: empty
ajaxBlogJoin:
view: views.blog.ajax_blog_join
url: /ajax/blogjoin/<int:blog_id>
methods:
- POST
renderer: json
----------------
Usage:
::
from flaskext.yamlconfig import install_yaml_config
yaml_config = install_yaml_config(app)
yaml_config("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:
....
yaml_config = install_yaml_config(app, MyConfig)
yaml_config("main.yaml")
Config file sample:
::
blog_edit:
view: views.blog.edit_blog
url: /blog/edit/<blog_url>
renderer: actions/blog/edit.html
methods:
- GET
- POST
context:
w_group: empty
ajaxBlogJoin:
view: views.blog.ajax_blog_join
url: /ajax/blogjoin/<int:blog_id>
methods:
- POST
renderer: json
Project details
Release history Release notifications | RSS feed
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.2.zip
(6.4 kB
view hashes)