[Flask] Add authentication to auto generated URLs
hcmr.verdonck.christof at gmail.com
Wed Mar 1 04:48:07 EST 2017
I am a quiet new developer for both Python and Flask.
To authenticate my Flask application, I am using the Flask extension:
To have a secured endpoint, I just add the @auth.login_required decorator
to the @app.route endpoint definition as shown here under:
return send_from_directory(app.static_folder, 'secret_page.html')
Now, I have some endpoints that I add dynamically as here under:
'secret_page_url/', view_func=view_func, methods=['POST', ])
I would like to add also authentication for these URLs but I can't
figure out how this is done.
It seems that the solution I have now, adds authentication on the
adding of the rule instead
of on the accessing of the URL.
Can someone please give me a hint/solution how this is done?
Thank you in advance
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Flask