db modifications
This commit is contained in:
parent
c2cee15a6f
commit
ab205f316b
13
App.py
13
App.py
@ -3,13 +3,13 @@ from flask import Flask, render_template, session, request, redirect, flash, g
|
|||||||
import os
|
import os
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
DATABASE = 'schema.sql'
|
DATABASE = 'inquire.db'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
with app.app_context():
|
|
||||||
db = g._database = sqlite3.connect(DATABASE)
|
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def home():
|
def home():
|
||||||
@ -56,9 +56,14 @@ def logout():
|
|||||||
def upvote():
|
def upvote():
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
print("upvoted")
|
print("upvoted")
|
||||||
|
with app.app_context():
|
||||||
|
db = g._database = sqlite3.connect(DATABASE)
|
||||||
|
db.execute("select * from user;")
|
||||||
|
print(db.fetchone())
|
||||||
return '200'
|
return '200'
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.secret_key = os.urandom(12)
|
app.secret_key = os.urandom(12)
|
||||||
app.run(host='0.0.0.0', debug = True)
|
app.run(host='0.0.0.0', debug = True)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user