Skip to content

Instantly share code, notes, and snippets.

@shinysu
Created June 5, 2021 10:12
Show Gist options
  • Save shinysu/e2f65fe391e730da0b6c456b39dc153b to your computer and use it in GitHub Desktop.
Save shinysu/e2f65fe391e730da0b6c456b39dc153b to your computer and use it in GitHub Desktop.
login1
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/login")
def login():
return render_template('login.html')
@app.route("/")
def index():
return render_template('welcome.html')
if __name__ == '__main__':
app.run(debug=True)
body{
font-size: 1.5em;
}
div{
margin: 5vh;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>login</title>
<link rel="stylesheet" href="{{url_for('static', filename='css/login.css')}}"
</head>
<body>
<form>
<div>
<label for="email"> Enter your email id: </label>
<input type="email" name="email">
</div>
<div>
<label for="password"> Enter your password: </label>
<input type="password" name="password">
</div>
<div>
<button type="submit" name="submit">Login</button>
</div>
</form>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Welcome</title>
</head>
<body>
<h1> Welcome</h1>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment