Example #1
0
import os
from flask import Flask, request, render_template, redirect, url_for, flash, Blueprint, make_response, session
import sqlite3
import traceback
import csv
import predict as p

current_dir = os.getcwd()
STATIC_FOLDER = current_dir + "/static/images/"
TEMPLATE_DIR = current_dir + "/templates/"
app = Flask(__name__)
app.config["static_folder"] = STATIC_FOLDER
app.config["template_folder"] = TEMPLATE_DIR
app.config.from_object(__name__)


@app.route("/")
def main():
    """
    Method called to render the landing page
    """
    return render_template("prices.html")


@app.route("/plot", methods=["POST", "GET"])
def plot():
    """
    Main method that plots the charts based on the input parameters
    """
    if request.method == "POST" and request.form is not None:
        types = []
Example #2
0
from flask import Flask, render_template

app = Flask(__name__)
app.config["STATIC_FOLDER"] = "/static"
app.config["template_folder"] = "/templates"


@app.route("/")
def hello():
    return "This is Index"


@app.errorhandler(404)
def page_not_found(e):
    return render_template("404.html"), 404


if __name__ == "__main__":
    app.run()