Home > Back-end >  How to import the same flask limiter in a structured flask app
How to import the same flask limiter in a structured flask app

Time:09-27

I'm trying to organize my Flask app, as it's getting quite big in length at close to 1000 lines

I am trying to separate the REST API from my main app, by using the approach shown here: enter image description here

So in my app's __init__, I have

from .limiter import limiter

And in the app/apis/v1.py I have

from .. import limiter

And this seems to finally work. I don't know if this is the expected way, meaning to play with relative module paths, so if there;s a more elegant way, please let me know

  • Related