The anwers depends on which framework you're using. For example, on Flask you should have something like this:
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'POST':
do_the_login()
else:
show_the_login_form()
That's taken from this section of the Flask docs where there's more detail.
For other frameworks you'll likely need to do something similar. The PA hosting should be method-agnostic (at least for standard methods) so the issue is almost certainly something in your application.
Whichever framework you use, don't forget to reload the application after making the change, or the change won't take effect.