-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to serve templates for custom routes ? #224
Comments
You can change templates loader: import jinja2
import os
from flask import render_template
from locust import web
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
my_loader = jinja2.ChoiceLoader([
jinja2.FileSystemLoader(os.path.join(PROJECT_ROOT, 'templates')),
web.app.jinja_loader,
])
web.app.jinja_loader = my_loader
@web.app.route("/stats")
def stats():
return render_template('stats.html') Really you can redefine |
Thank you very much On Fri, Jan 30, 2015 at 7:57 PM, Dmytro Kostochko [email protected]
Thnx, |
No description provided.
The text was updated successfully, but these errors were encountered: