Skip to content

Commit e1d0d23

Browse files
committed
klara arbiträra upload dirs
1 parent 4854eaa commit e1d0d23

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/tv.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from flask import Flask, render_template, flash, redirect, request, json
1+
from flask import Flask, render_template, flash, redirect, request, json, send_from_directory
22

33
from flask_sqlalchemy import SQLAlchemy
44
from flask_login import LoginManager
@@ -7,7 +7,7 @@
77

88
from config import Config as config
99

10-
app = Flask(__name__)
10+
app = Flask(__name__, static_folder=None)
1111
app.config.from_object(config)
1212

1313
app.app_context().push()
@@ -63,3 +63,7 @@ def pr():
6363
[("/static/pr/" + user.file_name)
6464
for user in PR.query.filter(PR.start_date < datetime.now()).all()]
6565
)
66+
67+
@app.route('/static/pr/<path:path>')
68+
def static(path):
69+
return send_from_directory(config.UPLOAD_FOLDER, path)

0 commit comments

Comments
 (0)