diff --git a/app.py b/app.py index feb4c3b..328f02b 100644 --- a/app.py +++ b/app.py @@ -16,9 +16,6 @@ import nh3 import vidzyconfig -inproduction = False -productionpath = os.path.expanduser('~/mysite') - CLEANR = re.compile('<.*?>') def cleanhtml(raw_html): @@ -810,8 +807,8 @@ def upload_file(): return redirect(request.url) if file and allowed_file(file.filename): filename = datetime.today().strftime('%Y%m%d') + secure_filename(file.filename) - if inproduction: - project_folder = productionpath # adjust as appropriate + if vidzyconfig.config["use_absolute_upload_path"]: + project_folder = vidzyconfig.config["vidzy_absolute_path"] file.save(os.path.join(project_folder + '/' + app.config['UPLOAD_FOLDER'], filename)) else: file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename)) diff --git a/vidzyconfig.py b/vidzyconfig.py index 54609a9..44e9cb0 100644 --- a/vidzyconfig.py +++ b/vidzyconfig.py @@ -1,3 +1,7 @@ +import os + config = { - "ALLOW_UPLOADS": True + "ALLOW_UPLOADS": True, + "use_absolute_upload_path": False, + "vidzy_absolute_path": os.path.expanduser('~/mysite') } \ No newline at end of file