pimoroni / phew

MIT License
204 stars 44 forks source link

GET info from a form ? #60

Closed optimal-system closed 8 months ago

optimal-system commented 9 months ago

I'm trying the example main.py with the method login (slightly modified) :

@server.route("/login", methods=["GET", "POST"])
def login_form(request):
    username = request.form.get("username", None)
    password = request.form.get("password", None)

    if username != "tom" and password != "123" :
        logged_in = False

    if not logged_in:
        return "Username or password not recognised", 401
    else :
        return "Logged in!", 200

There is no form showing up, just the message "Username or password not recognised"

Obviously I missing something ! Can you help please ?

optimal-system commented 8 months ago

It was just a little problem with the form.html... Sorry to make an issue with that.