Search code examples
pythonflaskpeewee

Init an empty Database instance


I want to use a factory method to create an app instance. To do this I need to init a Database inside that function. The problems is that I actually need the object before I create an app instance.

I tried this (https://github.com/coleifer/flask-peewee/issues/69) but it breaks my config file and I can't pass it to my models.

Any solution to this?


Solution

  • You might try the Proxy helper: http://peewee.readthedocs.org/en/latest/peewee/playhouse.html#proxy