@app.errorhandler(404)
def page_not_found(e):
    domain = request.host.split(":")[0]
    site_nickname = app.config["SITE_CONFIGURATION"].get(domain, None)
    if site_nickname is None:
        site_nickname = domain
    template_directory = os.path.join(app.root_path, "templates/", site_nickname)
    app.jinja_loader = FileSystemLoader(template_directory)
    media_url = "/media/%s/" + site_nickname
    return render_template('404.html', **{"MEDIA_URL": media_url, "url": reverse_url(site_nickname), "debug": app.config.get("DEBUG", False)}), 404


# Handle 500 errors
dataset/ETHPy150Open stochastic-technologies/static-appengine-hoster/application/__init__.py/page_not_found/operator `%` -> `+`