Can't use Django template

1 view
Skip to first unread message

Olli Wang

unread,
Sep 10, 2006, 11:23:47 AM9/10/06
to TurboGears
hi, folks. I just read and follow this page:
http://docs.turbogears.org/1.0/DjangoTemplating
I tried installed turbodjango and turbojinja, but both got the same
traceback:
Page handler: <bound method Root.page of <turbodj.controllers.Root
object at 0x01777C70>>
Traceback (most recent call last):
File
"c:\python24\lib\site-packages\CherryPy-2.2.1-py2.4.egg\cherrypy\_cphttptools.py",
line 105, in _run
self.main()
File
"c:\python24\lib\site-packages\CherryPy-2.2.1-py2.4.egg\cherrypy\_cphttptools.py",
line 254, in main
body = page_handler(*virtual_path, **self.params)
File "<string>", line 3, in page
File
"c:\python24\lib\site-packages\TurboGears-1.0b1-py2.4.egg\turbogears\controllers.py",
line 326, in expose
output = database.run_with_transaction(
File "<string>", line 5, in run_with_transaction
File
"c:\python24\lib\site-packages\TurboGears-1.0b1-py2.4.egg\turbogears\database.py",
line 246, in so_rwt
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File
"c:\python24\lib\site-packages\TurboGears-1.0b1-py2.4.egg\turbogears\controllers.py",
line 343, in <lambda>
mapping, fragment, args, kw)))
File
"c:\python24\lib\site-packages\TurboGears-1.0b1-py2.4.egg\turbogears\controllers.py",
line 380, in _execute_func
return _process_output(output, template, format, content_type,
mapping, fragment)
File
"c:\python24\lib\site-packages\TurboGears-1.0b1-py2.4.egg\turbogears\controllers.py",
line 74, in _process_output
fragment=fragment)
File
"c:\python24\lib\site-packages\TurboGears-1.0b1-py2.4.egg\turbogears\view\base.py",
line 116, in render
engine, template, enginename = _choose_engine(template)
File
"c:\python24\lib\site-packages\TurboGears-1.0b1-py2.4.egg\turbogears\view\base.py",
line 94, in _choose_engine
raise KeyError, \
KeyError: 'Template engine django is not installed'

I did install the django and could import django in python interpreter.
any ideas?

gasolin

unread,
Sep 10, 2006, 9:29:17 PM9/10/06
to TurboGears
Olli:

Excuse me that I've not test TurboDjango after tg 1.0b1 yet, but I'm
sure TurboJinja is work on 1.0b1(and py 2.4).

Can you see the template engine in "tg-admin info" command?

$ tg-admin info
---------------------------------------------
......
Template Engines

* kid (turbokid 0.9.8)
* cheetah (turbocheetah 0.9.5)
....
* jinja (turbojinja 0.9)
.......
---------------------------------------------


--
Fred


Olli Wang wrote:
> hi, folks. I just read and follow this page:
> http://docs.turbogears.org/1.0/DjangoTemplating
> I tried installed turbodjango and turbojinja, but both got the same
> traceback:

gasolin

unread,
Sep 10, 2006, 10:26:24 PM9/10/06
to TurboGears
I just update the TurboDjango widget, it should be worked well on
1.0b1.

If easy_install not work (sourceforge need some time to mirror the
file), you can download egg directly on sourceforge.

regards

--
Fred

Olli Wang

unread,
Sep 11, 2006, 1:34:21 AM9/11/06
to TurboGears
hi, gasolin. I just upgraded the turbodjango to version 0.95w2, but
still can't use it. here's part of my easy_install info.

* turbokid 0.9.8
* turbocheetah 0.9.5
* turbojson 0.9.9

* cheetah (turbocheetah 0.9.5)
* kid (turbokid 0.9.8)
* json (turbojson 0.9.9)
* jinja (turbojinja 0.9)

I'm curious about why there's no django in template engine and
turbodjango. BTW, I can use jinja now. Is jinja as fast as django? or
any other difference between them? thanks.

gasolin

unread,
Sep 11, 2006, 2:04:59 AM9/11/06
to TurboGears
If you really installed TurboDjango, you'll got something like this:

....
* jinja (turbojinja 0.9) # able to use
@expose("jinja:template")
* django (turbodjango 0.95w2) # able to use @expose("django:template")
....

And to be honest, TurboGears template plugin system is so good that I
don't really need to involve in django template/jinja to wrote a
plugin (jinja plugin took me an hour include testing). And I've no plan
to use django template/jinja in practice.

You may post your question and got answer in Django/Jinja community :-)

Reply all
Reply to author
Forward
0 new messages