summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-09-26 15:30:15 +0200
committerJules Laplace <julescarbon@gmail.com>2020-09-26 15:30:15 +0200
commitd260e3a65bdec981fd98db8a2352caa9bef9ae55 (patch)
treece04d69a1ed647c89b5dab93391c383d6beff14f /cli
parenta17b76ac75f506f5da6fe8adf9c36632b60d4226 (diff)
finalizing fixing refactor!!
Diffstat (limited to 'cli')
-rw-r--r--cli/app/server/web.py8
-rw-r--r--cli/app/settings/app_cfg.py5
2 files changed, 3 insertions, 10 deletions
diff --git a/cli/app/server/web.py b/cli/app/server/web.py
index 0436cd4..1a3b064 100644
--- a/cli/app/server/web.py
+++ b/cli/app/server/web.py
@@ -12,7 +12,7 @@ handler.setFormatter(formatter)
logger.addHandler(handler)
logging.getLogger().addHandler(logging.StreamHandler())
-from flask import Flask, Blueprint, send_from_directory, request
+from flask import Flask, send_from_directory, request
from app.sql.common import db, connection_url
from app.settings import app_cfg
@@ -25,8 +25,7 @@ def create_app(script_info=None):
"""
functional pattern for creating the flask app
"""
- logging.debug("Starting Flask app...")
-
+ logging.debug("Starting Swimmer server...")
app = Flask(__name__, static_folder=app_cfg.DIR_STATIC, static_url_path='/static')
app.config['SQLALCHEMY_DATABASE_URI'] = connection_url
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
@@ -45,9 +44,6 @@ def create_app(script_info=None):
@app.errorhandler(404)
def page_not_found(e):
return app.send_static_file(index_html), 200
- # path = os.path.join(os.path.dirname(__file__), './static/index.html')
- # with open(path, "r") as f:
- # return f.read(), 200
@app.route('/', methods=['GET'])
def index():
diff --git a/cli/app/settings/app_cfg.py b/cli/app/settings/app_cfg.py
index 0d724c7..5fc4982 100644
--- a/cli/app/settings/app_cfg.py
+++ b/cli/app/settings/app_cfg.py
@@ -58,10 +58,7 @@ URL_MEDIA = join(URL_DATA, 'media')
URL_UPLOADS = join(URL_DATA, 'uploads')
URL_EXPORTS = join(URL_DATA, 'exports')
-if 'cli' in os.getcwd():
- DIR_STATIC = os.path.abspath('../static')
-else:
- DIR_STATIC = os.path.abspath('static')
+DIR_STATIC = join(DIR_APP, 'static')
HASH_TREE_DEPTH = 3 # for sha256 subdirs
HASH_BRANCH_SIZE = 3 # for sha256 subdirs