-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathapp.py
40 lines (28 loc) · 910 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from flask import Flask, render_template, request, redirect, jsonify, \
url_for, flash
# from sqlalchemy import create_engine, asc, desc, \
# func, distinct
# from sqlalchemy.orm import sessionmaker
# from sqlalchemy.ext.serializer import loads, dumps
# from database_setup import Base, Things
import random
import string
import logging
import json
import httplib2
import requests
app = Flask(__name__)
# Connect to database and create database session
# engine = create_engine('sqlite:///flaskstarter.db')
# Base.metadata.bind = engine
# DBSession = sessionmaker(bind=engine)
# session = DBSession()
# Display all things
@app.route('/')
def showMain():
things = ["thing1", "thing2", "cat-in-the-hat"]
return render_template('things.html', things=things)
if __name__ == '__main__':
app.secret_key = 'super_secret_key'
app.debug = True
app.run(host='0.0.0.0', port=8000)