-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappBW.py
More file actions
28 lines (19 loc) · 684 Bytes
/
appBW.py
File metadata and controls
28 lines (19 loc) · 684 Bytes
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
# pip3 install psycopg2-binary
# pip3 install flask-sqlalchemy
# in ipython EVERY TIME: from sqlalchemy.sql import text
from flask import Flask, request, render_template, redirect, flash, session
from flask_debugtoolbar import DebugToolbarExtension
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql:///movies_example'
app.app_context().push()
db = SQLAlchemy()
db.app = app
db.init_app(app)
app.config['SECRET_KEY'] = 'secret'
app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False
debug= DebugToolbarExtension(app)
@app.route('/')
def home_page():
"""Shows home page"""
return render_template('home.html')