A while ago Doug and Eivind asked about using subdomains for each app.

I'd like to do this, but in the example they had a stab at they were  
using Apache whereas I'm using Lighttpd...


ideally I'd like subdomainone.wherever.com and  
subdomaintwo.wherever.com to pass through without anything AFTER the /.

I tried creating a root urls.py like this...

urlpatterns = patterns('',
        (r'^/?$', 'app.views.main'),
        (r'^admin/', include('django.contrib.admin.urls')),)

and a kinda main views.py like this...

def main(request):
        #handle any calls
        from django.conf.urls.defaults import *
        
        server_name = request.META['SERVER_NAME'].split(".")
        domain = server_name[0]
        
        if domain == 'subdomainone': urlpatterns = patterns('',  (r'^/?$',  
include('seo.one.urls')),       )
        if domain == 'subdomaintwo': urlpatterns = patterns('', (r'^/?$',  
include('seo.two.urls')),       )

..... of course I can get the domain out of the SERVER_NAME, but then  
setting urlpatterns doesn't actually DO anything does it?

regards

tom


        
        





------------------------------------------------------------------------ 
--------
Tom Smith
http://www.theotherblog.com     
yahoo, aim, skype: everythingability
mob: +44 (0) 7720 288 285       
tel: +44 (0) 1904 870 565
fax: +44 (0) 8716 613 413
----------- usability, findability, profitability, remarkability  
---------------



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

Reply via email to