Skip to content
Snippets Groups Projects
Commit 6d67fddc authored by Ferenc Schulcz's avatar Ferenc Schulcz
Browse files

Add option to serve static files in plugins

parent 9f3768b6
Branches
No related tags found
No related merge requests found
from flask import (Flask, render_template, render_template_string, redirect,
from flask import (Flask, render_template, render_template_string, send_from_directory, redirect,
session, request, flash, url_for, send_file)
from werkzeug.security import check_password_hash
from os.path import dirname, basename, isfile, join
......@@ -361,3 +361,8 @@ class RequestTools:
with open(args[1], 'r') as f:
template = f.read()
return render_template_string(template, **kwargs)
def serve_static(*args, **kwargs):
directory = args[1]
path = 'static/' + args[2]
return send_from_directory(directory, path, **kwargs)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment