main.py: Add note about using /tmp

I originally wanted to use an "uploads" directory or something, but
it seems we can only write to /tmp on Google App Engine. They really
want you to buy storage or database services! This is memory mapped
so it disappears when you re-deploy.
This commit is contained in:
Alan Orth 2021-03-13 22:08:23 +02:00
parent bc256b242d
commit adc2d06094
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -18,6 +18,8 @@ from werkzeug.utils import secure_filename
app = Flask(__name__) app = Flask(__name__)
app.config["MAX_CONTENT_LENGTH"] = 1024 * 1024 app.config["MAX_CONTENT_LENGTH"] = 1024 * 1024
app.config["UPLOAD_EXTENSIONS"] = [".csv"] app.config["UPLOAD_EXTENSIONS"] = [".csv"]
# the only place we can write to on Google App Engine is /tmp
# see: https://cloud.google.com/appengine/docs/standard/python3/using-temp-files
app.config["UPLOAD_PATH"] = "/tmp" app.config["UPLOAD_PATH"] = "/tmp"