Flask not finding routes in imported modules

前端 未结 2 539
悲&欢浪女
悲&欢浪女 2021-01-27 01:11

I\'m having a problem with Flask wherein routes declared in imported modules are not be registered and always result in a 404. I am running the latest version Flask on Python 2.

2条回答
  •  清酒与你
    2021-01-27 01:36

    You can do it by reorganizing your code as it is described here Larger Applications, but it is more recommended to divide them into smaller groups where each group is implemented with the help of a blueprint. For a gentle introduction into this topic refer to the Modular Applications with Blueprints chapter of the documentation.

    • Modular Applications with Blueprints

提交回复
热议问题