Renamed config value

From FILE_STORAGE to STORAGE_DIR to comply with the existing naming
schema.
This commit is contained in:
2015-10-08 14:30:32 +02:00
parent 6d32dc2894
commit af06a67d58
3 changed files with 7 additions and 7 deletions

View File

@@ -105,7 +105,7 @@ def index(file_name=None):
#POST file
file_name = request.form['name']
folder_name = file_name[:2]
file_folder_path = os.path.join(app.config['FILE_STORAGE'],
file_folder_path = os.path.join(app.config['STORAGE_DIR'],
folder_name)
if not os.path.exists(file_folder_path):
os.mkdir(file_folder_path)

View File

@@ -68,7 +68,7 @@ def index(file_name=None):
#POST file
file_name = request.form['name']
folder_name = file_name[:2]
file_folder_path = os.path.join(app.config['FILE_STORAGE'],
file_folder_path = os.path.join(app.config['STORAGE_DIR'],
folder_name)
if not os.path.exists(file_folder_path):
os.mkdir(file_folder_path)

View File

@@ -15,18 +15,18 @@ def runserver():
PORT = config.Development.PORT
HOST = config.Development.HOST
DEBUG = config.Development.DEBUG
app.config['FILE_STORAGE'] = config.Development.FILE_STORAGE
app.config['STORAGE_DIR'] = config.Development.STORAGE_DIR
except ImportError:
# Default settings
PORT = 5000
HOST = '0.0.0.0'
DEBUG = True
app.config['FILE_STORAGE'] = '{0}/application/static/storage'.format(
app.config['STORAGE_DIR'] = '{0}/application/static/storage'.format(
os.path.dirname(os.path.realpath(__file__)))
# Automatic creation of FILE_STORAGE path if it's missing
if not os.path.exists(app.config['FILE_STORAGE']):
os.makedirs(app.config['FILE_STORAGE'])
# Automatic creation of STORAGE_DIR path if it's missing
if not os.path.exists(app.config['STORAGE_DIR']):
os.makedirs(app.config['STORAGE_DIR'])
app.run(
port=PORT,