fix
This commit is contained in:
parent
94aadf1246
commit
a9d6ef6783
|
@ -2,4 +2,5 @@ pyyaml==6.0.1
|
||||||
chardet==5.2.0
|
chardet==5.2.0
|
||||||
humanize==4.9.0
|
humanize==4.9.0
|
||||||
mmh3==4.1.0
|
mmh3==4.1.0
|
||||||
flask==3.0.2
|
flask==3.0.2
|
||||||
|
python-magic==0.4.27
|
|
@ -1,4 +1,5 @@
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
import sqlite3
|
import sqlite3
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
@ -8,9 +9,12 @@ from flask import Flask, render_template, send_from_directory
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
if not os.environ.get('SQLITE3_DB'):
|
||||||
|
raise Exception('SQLITE3_DB not set.')
|
||||||
|
|
||||||
|
|
||||||
def get_db_connection():
|
def get_db_connection():
|
||||||
conn = sqlite3.connect('emails.db')
|
conn = sqlite3.connect(os.environ.get('SQLITE3_DB'))
|
||||||
conn.row_factory = sqlite3.Row
|
conn.row_factory = sqlite3.Row
|
||||||
return conn
|
return conn
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue