Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
updated user auth
- Loading branch information
Showing
4 changed files
with
49 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from flask_wtf import Form | ||
from wtforms import TextField, PasswordField | ||
from wtforms.validators import DataRequired | ||
|
||
|
||
class LoginForm(Form): | ||
username = TextField('Username', validators=[DataRequired()]) | ||
password = PasswordField('Password', validators=[DataRequired()]) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,32 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
|
||
<h1>Please login</h1> | ||
<br> | ||
<form action="" method="post"> | ||
<input type="text" placeholder="Username" name="username" value="{{request.form.username }}"> | ||
<input type="password" placeholder="Password" name="password" value="{{request.form.password }}"> | ||
<input class="btn btn-default" type="submit" value="Login"> | ||
<form class="form-signin" role="form" method="post" action=""> | ||
{{ form.csrf_token }} | ||
<p> | ||
{{ form.username(placeholder="username") }} | ||
<span class="error"> | ||
{% if form.username.errors %} | ||
{% for error in form.username.errors %} | ||
{{ error }} | ||
{% endfor %} | ||
{% endif %} | ||
</span> | ||
</p> | ||
<p> | ||
{{ form.password(placeholder="password") }} | ||
<span class="error"> | ||
{% if form.password.errors %} | ||
{% for error in form.password.errors %} | ||
{{ error }} | ||
{% endfor %} | ||
{% endif %} | ||
</span> | ||
</p> | ||
<button class="btn btn-sm btn-success" type="submit">Sign in</button> | ||
</form> | ||
|
||
{% endblock %} |
This file contains 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