Commit 154aa7d6 by aagusti

create static path

1 parent 0046a7f5
......@@ -1012,5 +1012,17 @@ def set_user_log(message, request, logobj=None, user_name=None):
logobj.warning(message)
def create_static_path(config, folder, url, cache_max_age=3600):
log.debug("Folder to create: %s", folder)
if not os.path.exists(folder):
try:
os.makedirs(folder)
except Exception as e:
log.debug("User: %s", os.path.expanduser("~"))
log.debug("Error: %s", str(e))
config.add_static_view(url, path=folder, cache_max_age=cache_max_age)
def includeme(config):
config.add_translation_dirs('opensipkd.tools:locale/')
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!