memegen.routes.examples.get()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 11
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 10
nop 0
dl 0
loc 11
rs 9.9
c 0
b 0
f 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