forked from miguelgrinberg/microblog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d45592
commit 3172e09
Showing
6 changed files
with
66 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from flask import Flask | ||
from config import Config | ||
|
||
app = Flask(__name__) | ||
app.config.from_object(Config) | ||
|
||
from app import routes |
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,10 @@ | ||
from flask_wtf import FlaskForm | ||
from wtforms import StringField, PasswordField, BooleanField, SubmitField | ||
from wtforms.validators import DataRequired | ||
|
||
|
||
class LoginForm(FlaskForm): | ||
username = StringField('Username', validators=[DataRequired()]) | ||
password = PasswordField('Password', validators=[DataRequired()]) | ||
remember_me = BooleanField('Remember Me') | ||
submit = SubmitField('Sign In') |
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
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,24 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
<h1>Sign In</h1> | ||
<form action="" method="post" novalidate> | ||
{{ form.hidden_tag() }} | ||
<p> | ||
{{ form.username.label }}<br> | ||
{{ form.username(size=32) }}<br> | ||
{% for error in form.username.errors %} | ||
<span style="color: red;">[{{ error }}]</span> | ||
{% endfor %} | ||
</p> | ||
<p> | ||
{{ form.password.label }}<br> | ||
{{ form.password(size=32) }}<br> | ||
{% for error in form.password.errors %} | ||
<span style="color: red;">[{{ error }}]</span> | ||
{% endfor %} | ||
</p> | ||
<p>{{ form.remember_me() }} {{ form.remember_me.label }}</p> | ||
<p>{{ form.submit() }}</p> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import os | ||
|
||
class Config(object): | ||
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess' |