mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 03:26:16 +00:00
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:
parent
a9b13f1e39
commit
828167f762
36 changed files with 819 additions and 131 deletions
|
@ -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)
|
Loading…
Add table
Add a link
Reference in a new issue