Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding the project name available to be used within the templates

  • Loading branch information...
commit 0af2e019e4f1ce72c60dcacb4341ca14943fd803 1 parent 54270fe
@puria puria authored
View
5 devtools/templates/turbogears/+package+/controllers/root.py_tmpl
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Main Controller"""
-from tg import expose, flash, require, url, lurl, request, redirect
+from tg import expose, flash, require, url, lurl, request, redirect, tmpl_context
from tg.i18n import ugettext as _, lazy_ugettext as l_
{{if auth == "sqlalchemy" or auth == "ming"}}
@@ -54,6 +54,9 @@ class RootController(BaseController):
error = ErrorController()
+ def _before(self, *args, **kw):
+ tmpl_context.project_name = "{{package}}"
+
@expose('{{package}}.templates.index')
def index(self):
"""Handle the front-page."""
Please sign in to comment.
Something went wrong with that request. Please try again.