Flask Shell Commands not working

后端 未结 2 1762
-上瘾入骨i
-上瘾入骨i 2021-02-15 13:32

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.

2条回答
  •  醉酒成梦
    2021-02-15 14:14

    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.

    Solution:

    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.

提交回复
热议问题