Added settings page

Added logging to a .log file
Fixed Images loosing colour and rotation on thumbnail generation
Added more info to README
This commit is contained in:
Michał Gdula 2023-03-01 23:29:34 +00:00
parent a9b13f1e39
commit 828167f762
36 changed files with 819 additions and 131 deletions

View file

@ -1,9 +1,15 @@
import sqlite3
import click
from flask import current_app, g
@click.command('init-db')
def init_db_command():
"""Create tables if not already created"""
init_db()
click.echo('Initialized the database!')
def get_db():
if 'db' not in g:
g.db = sqlite3.connect(current_app.config['DATABASE'],
@ -27,13 +33,6 @@ def init_db():
db.executescript(f.read().decode('utf8'))
@click.command('init-db')
def init_db_command():
"""Create tables if not already created"""
init_db()
click.echo('Initialized the database!')
def init_app(app):
app.teardown_appcontext(close_db)
app.cli.add_command(init_db_command)