Hi Jeremy,

The "url" function that the tutorial uses now made an assumption that
the root of your application extends turbogears.controllers.Root.
However, the Root class that your TurboGears 0.5.1 quickstart gave you
did not. So, this error cropped up.

I added some text to the url function's docstring and the Getting
Started guide to make this clearer. I've also changed the url function
so that it will set cherrypy.request.approot to something somewhat
useful rather than failing outright.

In your controllers.py, you can add the following import:
from turbogears import controllers

and then change the declaration of your Root class to be:
class Root(controllers.Root):

You can also update to the just-released 0.8a3, if you want.

Kevin

On 10/16/05, Jeremy <[EMAIL PROTECTED]> wrote:
>
> Ok, I followed the upgrade instructions by upgrading setuptools first
> and then upgrading turbogears.
>
> Here are the results:
> Removing setuptools 0.6a1 from easy-install.pth file
> Adding setuptools 0.6a5 to easy-install.pth file
>
> Installed
> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/setuptools-0.6a5-py2.4.egg
> ---------
> asimov:~/Desktop jeremy$ tg-admin
>
> TurboGears 0.8a2 command line interface
> ---------------------------------------------------
>
> So, it looks like I have setuptools version 0.6a5py2.4 and tg version
> 0.8a2.  Now I get this error:
>
> 500 Internal error
>
> Server got itself in trouble
>
> Traceback (most recent call last):
>   File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/CherryPy-2.1.0_rc2-py2.4.egg/cherrypy/_cphttptools.py",
> line 271, in run
>     main()
>   File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/CherryPy-2.1.0_rc2-py2.4.egg/cherrypy/_cphttptools.py",
> line 502, in main
>     body = page_handler(*args, **cherrypy.request.paramMap)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.8a2-py2.4.egg/turbogears/controllers.py",
> line 121, in newfunc
>     output = func(self, *args, **kw)
>   File "/Users/jeremy/wiki20/wiki20/controllers.py", line 15, in index
>     root = str(turbogears.url("/"))
>   File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/TurboGears-0.8a2-py2.4.egg/turbogears/__init__.py",
> line 32, in url
>     if cherrypy.request.approot != "/":
>   File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/CherryPy-2.1.0_rc2-py2.4.egg/cherrypy/__init__.py",
> line 70, in __getattr__
>     return getattr(childobject, name)
> AttributeError: _AttributeDump instance has no attribute 'approot'
> Powered by Cherrypy 2.1.0-rc2
> ---------------------------------------
>
> Thanks for the help!
>
> Jeremy
>
>
>


--
Kevin Dangoor
Author of the Zesty News RSS newsreader

email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com

Reply via email to