Skip to content

Commit

Permalink
klara arbiträra upload dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelambda committed May 4, 2024
1 parent 4854eaa commit e1d0d23
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/tv.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import Flask, render_template, flash, redirect, request, json
from flask import Flask, render_template, flash, redirect, request, json, send_from_directory

from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
Expand All @@ -7,7 +7,7 @@

from config import Config as config

app = Flask(__name__)
app = Flask(__name__, static_folder=None)
app.config.from_object(config)

app.app_context().push()
Expand Down Expand Up @@ -63,3 +63,7 @@ def pr():
[("/static/pr/" + user.file_name)
for user in PR.query.filter(PR.start_date < datetime.now()).all()]
)

@app.route('/static/pr/<path:path>')
def static(path):
return send_from_directory(config.UPLOAD_FOLDER, path)

0 comments on commit e1d0d23

Please sign in to comment.