>>>>>>>> Hello,
>>>>>>>> In tg1 there was a static folder that you aliased in your apache 
>>>>>>>> configuration.
>>>>>>>> so at the end you got this setup:
>>>>>>>> http://localhost:8080/static/images/logo.png
>>>>>>>> http://localhost:8080/static/css/style.css
>>>>>>>>
>>>>>>>>
>>>>>>>> I see that in tg2 there is no such folder.
>>>>>>>>
>>>>>>>> http://localhost:8080/images/logo.png
>>>>>>>> http://localhost:8080/css/style.css
>>>>>>>>
>>>>>>>> Which configuration I need to change to add a prefix folder. I would
>>>>>>>> like to get something like this:
>>>>>>>> http://localhost:8080/public/images/logo.png
>>>>>>>> http://localhost:8080/public/css/style.css
>>>>>>>>
>>>>>>>> What do I need to change?
>>>>>>> AFAIK (haven't quickstarted a TG2-app in a while & different resource
>>>>>>> handling anyway) there actually *is* a public/-directory.
>>>>>>>
>>>>>>> However, you can create aliases for apache for each directory - images,
>>>>>>> css, whatever.
>>>>>> Imagine you are deploying 3 tg2 apps using apache and mod_wsgi. How
>>>>>> are you going to differentiate the alias for  /images for the 3 apps?
>>>>> In the same way you disambiguate the three mod_wsgi-apps. Either by
>>>>> common prefix, or by vhost. How else?
>>>> In tg1 I change the prefix of the static folder in configuration file
>>>> to static-myapp and in apache I alias static-myapp
>>>> /path..to..static..folder/static/.
>>>> Tg1 app knows that it needs to get images from localhost/static-myapp/
>>>> and not from localhost/static.
>>>> In tg2, as far as I know there is now way to tell my app that images
>>>> are not under /localhost/images but they are in localhost/images-myapp
>>>> ?
>>> where does the /localhost/ come from? In a TG2-app, there are
>>> <myapp>/public/[css|javascript|images]-folders.
>>>
>>> Those are referred to as
>>>
>>> /css
>>>
>>> /javascript
>>>
>>> /images
>>>
>>> So creating aliases for these is the same as for creating them for a
>>> TG1-app. Yes, you need three of them - who cares?
>>
>> Because its not as easy as you are describing it here.
>
> Yes it is - just create *three* directory aliases, for each app of course.
>
> To distinguish between different apps, either use vhosts (certainly the
> best solution)

Do you have a sample vhost configuration that would allow me to do:

example.com/myapp
and one separate for
myapp.example.com

> or tg.url for rendering every url & set "server.webpath"

Is server.webpath available in tg2? Where do I set it? In tg1 I was
setting it in mod_wsgi config file only, but from the examples I seen
on tg2/pylons nowhere does it mention where to set it.


> to create a common prefix for all urls in each application.
>
>> Is there a similar functionality in tg2 as in app.cfg that describes:
>>
>> [/static]
>> static_filter.on = True
>> static_filter.dir = "%(top_level_dir)s/static"
>>
>> tg2 doesn't seem to have this section in there.
>
> It has a static middleware which creates the three different prefixes.
> The method setup_paths in tg.configuration determines how these are set
> up. You could overload that method, or provide a different config
> through self.paths. A look into the source reveals that - which you
> should certainly risk, given the beta-status of tg :)

Well, If you are saying that vhost / webpath will work and you have
tested it then I don't think I'll need it, hard to say. The fact that
it was available in tg1 seems to me that somebody needed it one point
or another.

Lucas

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to