To complete the challenge, we had to tap into the request
object. The Flask documentation was key in solving this challenge.
SOLUTION Code:
https://gist.github.com/angelabauer/045264ca6ad168b986f6687ee1368078
SOLUTION Walkthrough:
NOTE: The action attribute of the form can be set to "/login"
e.g.
<form action="/login" method="post">
or it can be dynamically generated with url_for
e.g.
<form action="{{ url_for('receive_data') }}" method="post">
Depending on where your server is hosted, the "/login"
path may change. So it's usually a better idea to use url_for
to dynamically generate the url for a particular function in your Flask server.