Skip to content

Instantly share code, notes, and snippets.

@TheMuellenator
Forked from angelabauer/index.html
Last active October 28, 2024 04:44
Show Gist options
  • Save TheMuellenator/c6177ac108650fdc8246d29ff0fab284 to your computer and use it in GitHub Desktop.
Save TheMuellenator/c6177ac108650fdc8246d29ff0fab284 to your computer and use it in GitHub Desktop.
Day 60 L458 - Simple HTML Form Revision
<!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>
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)
@TheMuellenator
Copy link
Author

Including basic main.py file in gist.

@Akhinh
Copy link

Akhinh commented Sep 22, 2023

i tried to use ROW and COl class in the div

@OldGoat5086
Copy link

I get a 404 error from running main and clicking on the development server address. Any Suggestions?

@OldGoat5086
Copy link

Had to refactor main.py to place it directly under the project name.

@DevSingh28
Copy link

t a 404 error from running main and clicking on the development server address. Any Sugg

can you share your code

@OldGoat5086
Copy link

OldGoat5086 commented Nov 18, 2023 via email

@pedsf1968
Copy link

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <h1>It works!</h1>
    <label>Name</label>
    <input type="text" id="name" name="name" placeholder="name"/>
    <label>Password</label>
    <input type="password" id="password" name="password" placeholder="password"/>
    <button type="submit">Ok</button>
</body>
</html>

@mhkocaoglan
Copy link

where is the half of course there is no video after flask and everything expected to learn by yourself

@DrCalebGordon
Copy link

I think flask is the last part of the curriculum that we learn. the rest is just making projects based off of what we learned

@mhkocaoglan
Copy link

sory sir, not at all, there are doesns of subjects that needs to be handled. flask is 54 th day and more projects starts after 80 th day.

@DevSingh28
Copy link

My nesting was all messed up. I believe this code works:  Main.py in venv Dictionary: rom flask import Flask, render_template, request app = Flask(name) @app.route('/') def home(): return render_template("index.html") @app.route("/login", methods=["POST"]) def receive_data(): name = request.form["username"] password = request.form["password"] return f"

Name: {name}, Password: {password}

" if name=="main": app.run(debug=True) index.html in templates dictionary <title>Test</title> Name Password Ok Good luck! In a message dated 11/18/2023 10:18:59 AM Eastern Standard Time, @.*** writes:  @DevSingh28 commented on this gist. t a 404 error from running main and clicking on the development server address. Any Sugg can you share your code — Reply to this email directly, view it on GitHub or unsubscribe. You are receiving this email because you commented on the thread. Triage notifications on the go with GitHub Mobile for iOS or Android.

name = request.form["username"]
password = request.form["password"] . The correct usage involves parentheses () rather than square brackets [] for method invocation.

@kubilaykaand
Copy link

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('/')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment