This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Flask-WaffleConf

WaffleConf is a Flask extension that enables storage of configuration variables in the database as well as runtime modification of said variables.

Released under GPLv2+ license.

Installation

$ pip install Flask-WaffleConf

Configuration

Simple usage of the extension requires the following configuration variables (e.g., in your application’s config.py):

  • WAFFLE_CONFS: used for specifying the configuration variables that are going to be stored in the database. It has the following structure:
WAFFLE_CONFS = {
    'MAX_FILESIZE': {
        'desc': 'Max upload filesize (in bytes)',
        'default': 1000
    },

    'SITENAME': {
        'desc': 'Name of the site appearing in the header',
        'default': 'Waffle'
    }
}

Check the documentation for advanced usage

Example Application using SQLAlchemy as ORM

from flask import Flask, current_app
from flask_waffleconf import WaffleConf, AlchemyWaffleStore, \
    WaffleMixin
from flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config['WAFFLE_CONFS'] = {
    'MAX_FILESIZE': {
        'desc': 'Max upload filesize (in bytes)',
        'default': 1000
    },

    'SITENAME': {
        'desc': 'Name of the site appearing in the header',
        'default': 'Waffle'
    }
}

# Define your database
# db = ...

# Define model
class ConfModel(db.Model, WaffleMixin):
    __tablename__ = 'confs'

    id = db.Column(db.Integer, primary_key=True)
    key = db.Column(db.String(255), unique=True)
    value = db.Column(db.Text)

# Create database tables
# ...

# Initialize WaffleConf
configstore = AlchemyWaffleStore(db=db, model=ConfModel)
waffle = WaffleConf(app, configstore)

@app.route('/')
def index():
    """Display content of configured variable 'SITENAME'."""
    state = current_app.extensions['waffleconf']

    parsed = state.parse_conf()
    # {'MAX_FILESIZE': 1000, 'SITENAME': 'Waffle'}

    return parsed['SITENAME']

Multiprocess deployments

Since version 0.2.0, multiprocess deployments are supported. Check the documentation for more information.

Documentation

Documentation is present in the docs/ directory and also online at https://flask-waffleconf.readthedocs.org. In order to build the documentation from source (you will need Sphinx), run the following command in the docs/ directory:

$ make html
Release History

Release History

0.3.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Flask_WaffleConf-0.3.1-py2.py3-none-any.whl (21.8 kB) Copy SHA256 Checksum SHA256 3.5 Wheel Jun 18, 2016
Flask-WaffleConf-0.3.1.tar.gz (23.0 kB) Copy SHA256 Checksum SHA256 Source Jun 18, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting