Environment var for UPLOAD_FOLDER (#314)

It would be helpful to have the option to set the UPLOAD_FOLDER via environment variable. This change allows that.
This commit is contained in:
Owlz
2017-07-15 18:01:22 -04:00
committed by Kevin Chung
parent 2e5c8a1adb
commit 5d35497f0c

View File

@@ -77,7 +77,7 @@ class Config(object):
The default destination is the CTFd/uploads folder. If you need Amazon S3 files
you can use the CTFd S3 plugin: https://github.com/ColdHeat/CTFd-S3-plugin
'''
UPLOAD_FOLDER = os.path.join(os.path.dirname(__file__), 'uploads')
UPLOAD_FOLDER = os.environ.get('UPLOAD_FOLDER') or os.path.join(os.path.dirname(__file__), 'uploads')
'''
TEMPLATES_AUTO_RELOAD specifies whether Flask should check for modifications to templates and