python - Running multiple Django sites on Windows in Virtual Host -


i have downloaded , installed django stack has apache, python , django. during installation setup created sample project configured run on one.local.com(127.0.0.1) , created project run on two.local.com(127.0.0.1).

.../two/wsgi.py

import os, sys  os.environ["python_egg_cache"] = ".../two/egg_cache" os.environ["django_settings_module"] = "two.settings"  sys.path.append('.../two') # i'm getting internal server error without  django.core.wsgi import get_wsgi_application application = get_wsgi_application() 

.../one/wsgi.py

import os, sys  os.environ["python_egg_cache"] = ".../one/egg_cache" os.environ["django_settings_module"] = "one.settings"  sys.path.append('.../one') # i'm getting internal server error without  django.core.wsgi import get_wsgi_application application = get_wsgi_application() 

and seems working fine on apache side site uses same settings of whichever happens run first.

below apache config used.

<virtualhost *:80>     servername two.local.com     serveralias two.local.com      <directory ".../two">         options +multiviews         allowoverride         require granted          wsgiapplicationgroup %{global}         require granted      </directory>      alias /static ".../python2.7/site-packages/django/contrib/admin/static"     wsgiscriptalias / '.../two/wsgi.py'  </virtualhost>  <virtualhost *:80>     servername one.local.com     serveralias one.local.com     ...     wsgiscriptalias / '.../one/wsgi.py' </virtualhost> 

i have spent lot of time trying fix don't know i'm missing here. so, great if answer this.

brief of problem:

django serving 2 different sites same content based on settings of site open first.

solution required:

  1. to fix above mentioned problem
  2. run using different virtualenv (wsgidaemonprocess not supported in windows)


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -