Non existing path when setting up Flask to have separated configurations for each environment
It took me a while but I finally found it:
Flask doesn't like projects with
__init__.py
at root level, deletemyapp/__init__.py
. This is the one located at the root folder:myapp├── __init__.py <--- DELETE...└── myapp ├── __init__.py <--- keep └── myapp.py
Use
$ export FLASK_APP=myapp/myapp.py
The environment variable specifying the configuration should be the absolut path to it:
export APP_CONFIG_FILE="/home/user/myapp/config/development.py"
Now everything works \o/
$ flask run* Serving Flask app "myapp.myapp"* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)$ flask shellPython 3.5.2+ (default, Sep 22 2016, 12:18:14) [GCC 6.2.0 20160927] on linuxApp: myappInstance: /home/user/myapp/instance>>>