flask: 使用shell执行代码中的函数

一,启动shell

$ source venv/bin/activate
((venv) ) [lhdop@blog enterprise_library_api]$ flask shell

二,执行函数

>>> from app.jobs.util import import_china_city
>>> import_china_city()

三,退出shell

>>> exit()
((venv) ) [lhdop@blog enterprise_library_api]$ 

 

posted @ 2026-03-20 11:24  刘宏缔的架构森林  阅读(2)  评论(0)    收藏  举报