I’m using Chalice for a REST API. The endpoints are starting to clutter up the app.py file so I decided to spread them out into other files via Blueprints. However, I have a custom authorization function called auth
created with @app.authorizer
@app.authorizer
def auth():
...
return AuthResponse...```
The problem is that it needs to be passed to the routes in a different file.
@blueprint1.route(“/get”, authorizer=auth, methods=[‘GET’], cors=cors_config)
def users():
…
return Response…“`
Using blueprints requires me to import them into app.py, but if I want to import the auth
function into the blueprint file, I have a circular import. How do Chalice devs normally handle this?