-
-
Save TheMuellenator/c6177ac108650fdc8246d29ff0fab284 to your computer and use it in GitHub Desktop.
Day 60 L458 - Simple HTML Form Revision
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<form> | |
<label>Name</label> | |
<input type="text" placeholder="name"> | |
<label>Password</label> | |
<input type="text" placeholder="password"> | |
<button type="submit">Ok</button> | |
</form> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
def home(): | |
return render_template("index.html") | |
if __name__ == "__main__": | |
app.run(debug=True) |
I get a 404 error from running main and clicking on the development server address. Any Suggestions?
in the source code of this page it says app.route('/'), where it should be : @app.route('/')
please help, I keep on running the current main.py but it seems there is another code running in the background. I am using PyCharm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
name = request.form["username"]
password = request.form["password"] . The correct usage involves parentheses () rather than square brackets [] for method invocation.