You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
973 B
33 lines
973 B
5 years ago
|
from flask import Flask, url_for, render_template, Markup, redirect, request, flash
|
||
|
from flask import session as login_session
|
||
|
from flask_wtf import FlaskForm
|
||
|
from wtforms.validators import DataRequired
|
||
|
from wtforms import Form, TextField, TextAreaField, BooleanField, validators, StringField, SubmitField
|
||
|
from forms import ReusableForm
|
||
|
from config import Config
|
||
|
import json
|
||
|
|
||
|
app = Flask(__name__, static_url_path='', static_folder="static", template_folder="templates")
|
||
|
app.config.from_object(Config)
|
||
|
|
||
|
@app.route("/")
|
||
|
def home():
|
||
|
return render_template('home.html')
|
||
|
|
||
|
@app.route('/about/')
|
||
|
def about():
|
||
|
return render_template('about.html')
|
||
|
|
||
|
@app.route('/description/', methods=['GET', 'POST'])
|
||
|
def description():
|
||
|
form = ReusableForm(request.form)
|
||
|
print (form.errors)
|
||
|
if request.method == 'POST' and form.validate():
|
||
|
return 'Success'
|
||
|
return render_template('description.html', form=form)
|
||
|
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
app.run(debug=True)
|