mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 11:36:16 +00:00
Added temporary fix to loading images on the home page Fix api.py for requesting images Minor tweaks to default theme
13 lines
No EOL
449 B
Python
13 lines
No EOL
449 B
Python
from flask import Blueprint, render_template, current_app, send_from_directory
|
|
from werkzeug.utils import secure_filename
|
|
import os
|
|
|
|
blueprint = Blueprint('viewsbp', __name__, url_prefix='/')
|
|
|
|
|
|
@blueprint.route('/uploads/<quality>/<file>')
|
|
def uploads(quality, file):
|
|
dir = os.path.join(current_app.config['UPLOAD_FOLDER'], secure_filename(quality))
|
|
file = secure_filename(file)
|
|
|
|
return send_from_directory(dir, file, as_attachment=True) |