mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-01-19 12:58:31 +00:00
Michał
44a6712b6e
Added temporary fix to loading images on the home page Fix api.py for requesting images Minor tweaks to default theme
13 lines
449 B
Python
13 lines
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) |