__init__.py 729 Bytes
Newer Older
kaiyou's avatar
kaiyou committed
1
from flask import Flask
kaiyou's avatar
kaiyou committed
2 3 4

import os

kaiyou's avatar
kaiyou committed
5
app = Flask(__name__)
kaiyou's avatar
kaiyou committed
6
app.debug = "FLASK_DEBUG" in os.environ
kaiyou's avatar
kaiyou committed
7 8

app.config.update(
kaiyou's avatar
kaiyou committed
9
    SITE_NAME=os.environ.get("SITE_NAME", "TedImg"),
10 11
    SOURCE_URL="https://forge.tedomum.net/tedomum/tedimg",
    HELP_URL="https://forge.tedomum.net/tedomum/tedimg",
12
    FOOTER_CONTENT=os.environ.get("FOOTER_CONTENT", ""),
kaiyou's avatar
kaiyou committed
13 14
    FULL_STORAGE=os.environ.get("FULL_STORAGE", "/data"),
    THUMB_STORAGE=os.environ.get("THUMB_STORAGE", "/data/thumb"),
15 16
    FULL_WEB=os.environ.get("FULL_WEB", "data"),
    THUMB_WEB=os.environ.get("THUMB_WEB", "data/thumb"),
kaiyou's avatar
kaiyou committed
17
    THUMB_SIZE=100
kaiyou's avatar
kaiyou committed
18 19
)

kaiyou's avatar
kaiyou committed
20 21 22 23
if (app.debug):
    from werkzeug import debug
    app.wsgi_app = debug.DebuggedApplication(app.wsgi_app, True)

kaiyou's avatar
kaiyou committed
24
import tedimg.views