rmed

blog

Flask-WaffleConf

2015-08-19 07:55

Flask-WaffleConf is a Flask extension that allows you to store configuration variables in the database, read them on startup and update them on runtime. It's kind of an experiment in order to try making a Flask extension from scratch and add the functionality to the website in a modular way. If you are wondering about the reason behind the name, go ask ~~@adolphenom~~ @captainepoch.

The way it works is pretty simple:

  • You define a database model that will act as configuration store
  • Instantiate the WaffleConf object with the application
  • Register the view with any Blueprint

For the time being (you know... alpha state), I've just added a peewee configuration store, but creating stores for other databases should not be too complicated: simply subclass the WaffleStore class and you are ready to go. However, I would recommend checking the documentation first, just in case :)

Released under GPLv2+ license.

Comments, issues and pull requests are more than welcome!