I've done something similar to this, putting the site language in the url.
Basically you create a middleware process_request, that will take request.path and set it to something else. For example you might do: request.path = "/app/theme/view/" parts = request.path.split("/") request.path = "/"+parts[0]+"/"+parts[2] theme = parts[1] #do something with the theme... return None Then your urlconfs will go on without knowing about the theme logic. Beware, though: This can lead to many strange errors when this catches paths you don't want to be processed. You also have to worry about search engines. It might be better to apply the same middleware to extract something from the session/query parameters. On May 31, 1:23 am, Robert Coup <[EMAIL PROTECTED]> wrote: > Chris Kelly wrote: > > I am in the process of writing an app that will have a "theme" based > > on if a subdirectory is specified e.g.: > > >http://somesite.com/app/(theme)/abunchofviews/ > > > basically, if they go to /app/bluetheme/register, it'll give them a > > registration page with a blue theme header and footer (it looks up a > > theme object based on the value specifed in the url, and gets header > > images, etc from said object). Likewise, if "greentheme" is specified, > > they would get a green-themed registration page. This way, someone can > > later just go into the django admin section and create a new "theme" > > by specifying a new header and footer image. > > I know it doesn't answer your question, but search engines will see a > different page for each different theme (eg. /red/mypage1 will be seen > as a different page from /green/mypage1). > > Maybe storing the theme in a user preference/session might be easier? A > user could visit /theme/green/ to set the 'green' theme, then redirect > to any of your normal application pages, which use the preference to > decide . > > Rob :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---