send from directory prefix

master
km0 3 years ago
parent b02cbf8732
commit 9f4801f009

@ -1,6 +1,8 @@
from flask import Blueprint, render_template, send_from_directory
import json
from . import dump
import os
bp = Blueprint(
"generate",
@ -22,4 +24,6 @@ def postit():
@bp.route("/<slug>/<filename>/")
def send_static(slug=None, filename=None):
return send_from_directory(f"/postit/contents/{slug}", filename)
return send_from_directory(
f'{os.environ.get("URL_PREFIX")}/postit/contents/{slug}', filename
)

Loading…
Cancel
Save