python - Django with multiple subdomains - sometimes renders incorrect template -


bizarre:

i have 2 domains:

  • www.domain.com
  • app.domain.com

both individual settings.py, urls.py, , wsgi.py files (set this: http://michal.karzynski.pl/blog/2010/10/19/run-multiple-websites-one-django-project/)

sometimes--maybe 30% of time--everything works fine. when visit www.domain.com, have pages such /login, /contact, /join. it's standard django site.

app.domain.com single page app, urls file looks this:

from django.conf.urls import include, url  .app_views import index  urlpatterns = [     url(r'^.*$', index, name='app'), ] 

so, time user visits app.domain.com or app.domain.com/foo or app.domain.com/anything, want render index function.

now, sometimes, i'll visit app.domain.com, , www.domain.com template rendered. not that, i'll have urls such app.domain.com/login or app.domain.com/contact

weird!

even stranger, if go www.domain.com, app.domain.com index template rendered!

if refresh page few times, correct page, seems random , unpredictable.

has encountered before or know what's up?

24 hours later.... lesson learned:

if you're using multiple wsgidaemonprocesses in distinct virtualhosts, configure wsgiprocessgroup. in case, should have mirrored servername of virtualhost.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -