Skip to content Skip to sidebar Skip to footer

Flask Shell Commands Not Working

I'm new to python and flask and currently working on the Flask Mega-Tutorial, however: I'm stuck getting flask shell to recognize my custom symbols/commands. When I try to access

Solution 1:

Thanks a lot to Miguel, the writer of the FLASK Mega Tutorial (go check that out) wo solved my problem!

As he pointed out in a comment below my question: you cannot have a module and a package with the same name. So no application folder and application.py at the same time.

Answer :

I changed my 'application.py into 'theapp.py' and now flask shell works like a charm! I did not need to change anything in my files, apart from running export FLASK_APP=theapp.py in the terminal.

Solution 2:

Flask needs to be told how to import it, by setting the

FLASK_APP:(venv) $ export FLASK_APP=microblog.py

If you are using Microsoft Windows, use set instead of export in the command above.

Post a Comment for "Flask Shell Commands Not Working"