memegen.routes.examples   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A get() 0 11 1
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