Example #1
0
import os 
from flask import Flask, render_template, send_from_directory, request, flash, redirect, url_for
from flask.ext.basicauth import BasicAuth

app = Flask(__name__)

app.secret_key = "notemetaipo"
app.CSRF_ENABLED = True
app.WTF_CSRF_SECRET_KEY = '*YQUIHDHQYP#*p94uUOI'

app.config.update(
    DEBUG=True
)

app.config['BASIC_AUTH_USERNAME'] = 'teralytics'
app.config['BASIC_AUTH_PASSWORD'] = ''
basic_auth = BasicAuth(app)

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

    
@app.route("/", methods=['GET', 'POST'])
def index():
    return render_template('index.html')
    
@app.route("/basics", methods=['GET', 'POST'])
@basic_auth.required
def basics():
    return render_template('basics.html')
Example #2
0
File: app.py Project: RiB-/strategy
import os 
from flask import Flask, render_template, send_from_directory, request, flash, redirect, url_for
import MySQLdb
#from events import *
from marketsim import analysis
from forms import InputForm
from find_events import *
from kalman import *
from util import *
from flask import jsonify

app = Flask(__name__)

app.secret_key = "talca"
app.CSRF_ENABLED = True
app.WTF_CSRF_SECRET_KEY = 'a random string'

app.config.update(
    DEBUG=True
)

con = mdb.connect(host='localhost', user='root', db='stocks2')
cur = con.cursor()

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

    
@app.route("/", methods=['GET', 'POST'])
def index():