Flask-Project-Template/src/core/routes/Routes.py

25 lines
700 B
Python
Raw Normal View History

# Python imports
# Lib imports
2019-12-22 19:09:36 +00:00
from flask import request, render_template
# App imports
from core import app, db # Get from __init__
2020-03-06 07:27:02 +00:00
from core.models import Table # Get db models
from core.MessageHandler import MessageHandler # Get simple message processor
2019-11-01 22:54:25 +00:00
2019-12-22 19:09:36 +00:00
2019-11-01 22:54:25 +00:00
msgHandler = MessageHandler()
TITLE = app.config['TITLE']
2019-11-01 22:54:25 +00:00
@app.route('/', methods=['GET', 'POST'])
def root():
if request.method == 'GET':
return render_template('index.html',
title=TITLE)
2020-01-12 19:32:47 +00:00
return render_template('error.html',
title='Error!',
message='Must use GET request type...')