i'm trying to perform basic authentication in bottle framework
def is_authenticated_user(user, password):
# This function is called to check if a username/password combination is valid
return username == 'nikos' and password == ******'
and call it as:
@app.route( '/file', methods=['POST'] )
@auth_basic( is_authenticated_user )
....
....
filename = request.form.get('filename') return static_file( filename, root='/home/nikos/wsgi/static/files' )
I'm having trouble making this work, i dont understnad why i'm getting the error method not allowed. Also is the static_file function the correct way to send a file to the user's browser?
If you want please help me with this issue which si driving me crazy https://stackoverflow.com/questions/52466285/method-is-not-allowed-when-i-add-post-as-a-method-in-a-view-function – Νικόλαος Βέργος Sep 23 '18 at 15:44