On Thu, 25 Dec 2008 21:08:26 -0800 (PST)
Aigarius <[email protected]> wrote:

> Let's assume that we have the main site on http://www.example.com and
> we want our users to be able to do actions on different types of
> objects. While we could use URL such as
> http://www.example.com/cars/Toyota/diesel/2003/ and have the root
> controller contain a line such as:
>
> cars = CarController()
>
> We would like to be able to use URLs like
> http://cars.example.com/Toyota/diesel/2003/ and have that be handled
> by a separate controller within the same TG2 application.
>
> Could someone please point me to a proper way of doing such a thing?

The requirement "within the same TG2 application" is kind of nebulous.

Let's assume that you want to share your model and your views, but
maintain different controllers. You'll build one of your applications,
"www", as an individual project. Once that project is running, you
copy
it to "cars", rename controllers/root.py to controllers/shared.py and
build a new controllers/root.py, importing any controller classes you
want to use from shared.py. You edit the second "development.ini" so
that it responds to the "cars..." domain instead of www.

If both of those domains resolve to the same IP address, you may need
to do a WSGI deployment under Apache.

Chris Babcock

--~--~---------~--~----~------------~-------~--~----~
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