Hi,
I am planning to have multiple site running from one Django Codebase using Apache + mod_wsgi. Could anyone please help me in achieving this.
Hi,
I am planning to have multiple site running from one Django Codebase using Apache + mod_wsgi. Could anyone please help me in achieving this.
every Django project should have it's own mod.wsgi file (not necessarily called mod.wsgi, btw) which looks like :
import os, sys
sys.path.append('DJANGO_PATH')
sys.path.append('DJANGO_PATH/SITEPATH')
os.environ['DJANGO_SETTINGS_MODULE'] = 'SITE.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
where DJANGO_PATH is the path where all your Django projects were created, SITEPATH is the folder where your specific project resides.
in Apache make a virtualhost for every site that refers to their own mod.wgsi files, like :
WSGIScriptAlias / /DJANGOPATH/SITEPATH/mod.wsgi
repeat for all sites.