flectra/doc/howtos/website/routing-basic

20 lines
644 B
Plaintext
Raw Normal View History

# HG changeset patch
# Parent 0795247fa6cbb63238941f3dd26a8b6144fa71ee
# Parent f66ff336f8ed20e022660bd74a43af1b44a1f275
diff --git a/academy/controllers.py b/academy/controllers.py
--- a/academy/controllers.py
+++ b/academy/controllers.py
@@ -9,6 +9,11 @@ class Academy(http.Controller):
'teachers': Teachers.search([])
})
+ @http.route('/academy/<name>/', auth='public', website=True)
+ def teacher(self, name):
+ return '<h1>{}</h1>'.format(name)
+
+
# @http.route('/academy/academy/objects/', auth='public')
# def list(self, **kw):
# return http.request.render('academy.listing', {