Django with multiple websites, shared apps, one domain, Apache server

17 views Asked by At

The goal is to have several websites running on one domain, with Apache and wsgi

What I currently have is one virtualhost configuration: WSGIScriptAlias /site1 /opt/django/wsgi.py process-group=site1

Since there is only one project, there is only one wsgi.py, so all apps are running under domain.com/site1, i.e. site2 is available at domain.com/site1/site2 which is not what I want.

The desired config is : site1 reachable at domain.com/site1 site2 reachable at domain.com/site2.

Also, there are some shared apps between site1 and site2.

project/urls.py configuration: path('', include(('site1.urls', 'site1'), namespace='site1')), path('/site2', include(('site2.urls', 'site2'), namespace='site2')),

0

There are 0 answers