Renamed config value
From FILE_STORAGE to STORAGE_DIR to comply with the existing naming schema.
This commit is contained in:
@@ -105,7 +105,7 @@ def index(file_name=None):
|
|||||||
#POST file
|
#POST file
|
||||||
file_name = request.form['name']
|
file_name = request.form['name']
|
||||||
folder_name = file_name[:2]
|
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)
|
folder_name)
|
||||||
if not os.path.exists(file_folder_path):
|
if not os.path.exists(file_folder_path):
|
||||||
os.mkdir(file_folder_path)
|
os.mkdir(file_folder_path)
|
||||||
|
@@ -68,7 +68,7 @@ def index(file_name=None):
|
|||||||
#POST file
|
#POST file
|
||||||
file_name = request.form['name']
|
file_name = request.form['name']
|
||||||
folder_name = file_name[:2]
|
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)
|
folder_name)
|
||||||
if not os.path.exists(file_folder_path):
|
if not os.path.exists(file_folder_path):
|
||||||
os.mkdir(file_folder_path)
|
os.mkdir(file_folder_path)
|
||||||
|
@@ -15,18 +15,18 @@ def runserver():
|
|||||||
PORT = config.Development.PORT
|
PORT = config.Development.PORT
|
||||||
HOST = config.Development.HOST
|
HOST = config.Development.HOST
|
||||||
DEBUG = config.Development.DEBUG
|
DEBUG = config.Development.DEBUG
|
||||||
app.config['FILE_STORAGE'] = config.Development.FILE_STORAGE
|
app.config['STORAGE_DIR'] = config.Development.STORAGE_DIR
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# Default settings
|
# Default settings
|
||||||
PORT = 5000
|
PORT = 5000
|
||||||
HOST = '0.0.0.0'
|
HOST = '0.0.0.0'
|
||||||
DEBUG = True
|
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__)))
|
os.path.dirname(os.path.realpath(__file__)))
|
||||||
|
|
||||||
# Automatic creation of FILE_STORAGE path if it's missing
|
# Automatic creation of STORAGE_DIR path if it's missing
|
||||||
if not os.path.exists(app.config['FILE_STORAGE']):
|
if not os.path.exists(app.config['STORAGE_DIR']):
|
||||||
os.makedirs(app.config['FILE_STORAGE'])
|
os.makedirs(app.config['STORAGE_DIR'])
|
||||||
|
|
||||||
app.run(
|
app.run(
|
||||||
port=PORT,
|
port=PORT,
|
||||||
|
Reference in New Issue
Block a user