| Total Complexity | 1 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from flask import Blueprint, render_template, current_app, make_response |
||
|
|
|||
| 2 | |||
| 3 | from ._utils import samples |
||
| 4 | |||
| 5 | |||
| 6 | blueprint = Blueprint('examples-page', __name__) |
||
| 7 | |||
| 8 | |||
| 9 | @blueprint.route("/examples") |
||
| 10 | def get(): |
||
| 11 | sample_images = list(samples()) |
||
| 12 | html = render_template( |
||
| 13 | "examples.html", |
||
| 14 | sample_images=sample_images, |
||
| 15 | config=current_app.config, |
||
| 16 | ) |
||
| 17 | response = make_response(html) |
||
| 18 | response.headers['Cache-Control'] = f'max-age={60*60*24*7}' |
||
| 19 | return response |
||
| 20 |