예제 #1
0
def not_found(error):
    segments = ["404"]
    images = assets_in_paths(app, segments)
    filename = choice(images)
    image = os.path.join("404", filename)
    # 404s should still send the 404 status to the application.
    return render_template("404.html", image=image), 404, {}
예제 #2
0
파일: views.py 프로젝트: jameysharp/dcon
def universe_context(app, u):
    segments = [u.slug, "images", "banners"]
    banners = assets_in_paths(app, segments)

    if banners:
        segments.append(choice(banners))
        banner = "/".join(segments)
    else:
        banner = None

    return {
        "u": u,
        "banner": banner,
    }
예제 #3
0
파일: views.py 프로젝트: jameysharp/dcon
def not_found(error):
    segments = ["404"]
    images = assets_in_paths(app, segments)
    filename = choice(images)
    image = os.path.join("404", filename)
    return render_template("404.html", image=image)