mirror of
https://github.com/FAUSheppy/python-flask-picture-factory
synced 2025-12-06 07:01:37 +01:00
feat: docker alpine support & misc fixes
This commit is contained in:
12
server.py
12
server.py
@@ -8,11 +8,14 @@ import werkzeug.utils
|
||||
import json
|
||||
|
||||
app = flask.Flask("Picture factory app", static_folder=None)
|
||||
PICTURE_DIR = "pictures/"
|
||||
|
||||
app.config['MAX_CONTENT_PATH'] = 32+1000*1000
|
||||
app.config['UPLOAD_FOLDER'] = PICTURE_DIR
|
||||
app.config['UPLOAD_ENABLED'] = os.path.isfile("./upload.enable")
|
||||
|
||||
PICTURE_DIR = os.environ.get("PICTURES_DIRECTORY") or "pictures/"
|
||||
app.config['UPLOAD_FOLDER'] = PICTURE_DIR
|
||||
|
||||
ENV_UPLOAD_ENABLED = os.environ.get("UPLOAD_ENABLED").lower() in ["yes", "true", "1"]
|
||||
app.config['UPLOAD_ENABLED'] = os.path.isfile("./upload.enable") or
|
||||
|
||||
def generatePicture(pathToOrig, scaleX, scaleY, encoding, crop):
|
||||
'''Generate an pictures with the requested scales and encoding if it doesn't already exist'''
|
||||
@@ -167,6 +170,9 @@ def upload():
|
||||
else:
|
||||
return flask.render_template("upload.html")
|
||||
|
||||
def create_app():
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
parser = argparse.ArgumentParser(description='Picture Factory',
|
||||
|
||||
Reference in New Issue
Block a user