Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Version 1 (modified by elvelind@…, 14 years ago) (diff)


With TurboGears 0.9 (or svn rev 106) quickstart now uses PasteScript and therefor supports user templates. So lets go ahead and create one of those!

lets say that you have a default.css file that you always include in your webapp.

lets start creating some files and dirs.

mytemplate/ mytemplate/ mytemplate/mytemplate/ mytemplate/mytemplate/template/+package+/static/css/default.css

first we will edit the

from setuptools import setup, find_packages
from turbogears import finddata

      packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
              mytemplate = mytemplate:MyTemplate

this setup basicly tells pasterscript that there is an template called mytemplate and it's class is MyTemplate? in the mytemplate module

now lets edit

from paste.script import templates
import pkg_resources

class MyTemplate(templates.Template):

    egg_plugins = ['MyTemplate']
    _template_dir = pkg_resources.resource_filename("mytemplate", "template")
    summary = "my own cute template"

now all you have to do is add anything to the template dir.

now when you can run tg-admin quickstart -t mytemplate and there should be a default.css file in your static/css/ dir!

see for more info

/elvelind grandin