python - Django Apache Subdomains -


i followed steps reference link multiple sites in django , configured in apache .but 1 thing how call domains in templates

if type domain names directly in address bar working. want server through links(<a href="">domain1</a>)

for both separate settings.py , wsgi.py mentioned above.

i have separate urls both.

domain1_urls.py

from django.conf.urls import patterns, include, url  urlpatterns = patterns('',     url(r'^$', 'domain1.views.domain1', name='domain1'), ) 

domain2_urls.py

from django.conf.urls import patterns, include, url  urlpatterns = patterns('',     url(r'^$', 'domain2.views.domain2', name='domain2'), ) 

index.html

<li><a href="{% url 'domain1' %}">domain1</a></li>        <li><a href="{% url 'domain2' %}">domain2</a></li> 

the landing page domain1 ..in landing page template there link domain2. if click redirecting domain1 itself. not working me,both urls domian1 , domain 2 servers '/' how differentiate both while calling in templates on common index.html.

please tell me mistake made here..if suggestion please let me know ..thanks in advance.

your both url points same root(/), try follows

in domain2_urls.py

from django.conf.urls import patterns, include, url  urlpatterns = patterns('',     url(r'^domain2/$', 'domain2.views.domain2', name='domain2'), ) 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -