On 5/16/06, Randy <[EMAIL PROTECTED]> wrote:
>
> Actually neither of them worked, I was testing them individually but
> tossed both of them into my example.
>
> I'm still getting
> <LINK MEDIA="all" HREF="/tg_widgets/myproj/css/mywidget.css"
> TYPE="text/css" REL="stylesheet">
>
> Is turbogears supposed to be creating and putting widgets in a
> temporary "tg_widgets" directory?  As far I can tell there is no such
> directory on my computer, and it certainly won't find any stylesheets
> there.

The key to keep in mind here is that, generally speaking, TG doesn't
work with directories. URLs map to objects in the Python name space
(truth be told, for a while I've been angling to make this more
explicit with static directories, which are currently configured via
the config file -- I'd like them to be represented by objects you drop
into your object hierarchy).

When you call register_static_directory, TurboGears tells CherryPy to
"mount" your static directory at a certain point in the URL space. It
happens to start that off with "tg_widgets", as I said in the earlier
message, to ensure that the widget names don't conflict with your
controller methods by some weird chance.

> This is what would seem to make sense.
> <LINK MEDIA="all" HREF="/myproj/static/css/mywidget.css"
> TYPE="text/css" REL="stylesheet">

In this particular example, you *could* get to that by going to
/static/css/mywidget.css, because quickstart automatically registers
that static directory with CherryPy.  However, there isn't anything in
CherryPy that would be answering to the "myproj" part.

The key point to take away: in a traditional website, URLs map to
files and directories. In a web application, URLs can map to
*anything* files, directories, python objects...

Kevin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to