abilian / abilian-core

Abilian Core framework and services
http://www.abilian.com/
GNU Lesser General Public License v2.1
48 stars 11 forks source link

Use "flask" command instead of "extranet_" #25

Open vindarel opened 7 years ago

vindarel commented 7 years ago

new since 0.11 http://flask.pocoo.org/docs/0.12/cli/

vindarel commented 7 years ago

We need to export a FLASK_APP.

core or other projects don't have a simple app variable in their app.py, but a class that inherits the Flask object:

class Application(Flask, ServiceManager, PluginManager):

and

def create_app(config=None):
    return Application(config)

Defining export FLASK_APP=abilian.app:create_app is not enough.

sfermigier commented 7 years ago

cf. http://mitsuhiko.pocoo.org/flaskfun.pdf (slides 24+)

sfermigier commented 7 years ago

One needs a very basic devapp.py in each project that depends on abilian-core.

sfermigier commented 7 years ago

And to convert existing scripts (that use flask-script) to the new API (should be easy).

vindarel commented 7 years ago

OK thanks, a devapp.py at the project root and export FLASK_APP=devapp works.

vindarel commented 7 years ago

see https://github.com/abilian-private/extranet-spr/issues/10 and https://github.com/abilian-private/extranet-mpr/issues/20