If only to possess multiple django installations. One at / (that is working fine) and something at /adam. The main one at slash adam is rerouted by apache properly, before you try to visit an application. E.g. /admin works but /adam/admin doesn't work. I recieve the mistake:
Page not found (404) Request Method: GET Request URL: http://[CENSORED]/adam/ Using the URLconf defined in bms.urls, Django tried these URL patterns, in this order: ^admin/doc/ ^admin/ The current URL, , didn't match any of these.
Spot the empty commas. The apache virtual host is:
<VirtualHost *:80> ServerName [CENSORED] DocumentRoot /home/user/bms Alias /static/admin/ /usr/local/lib/python2.7/site-packages/Django-1.3-py2.7.egg/django/contrib/admin/media/ <Directory /home/user/bms/apache> Order allow,deny Allow from all </Directory> <Directory /home/ajt1g09/bms/apache> Order allow,deny Allow from all </Directory> WSGIDaemonProcess bms user=user group=user processes=2 threads=25 python-path=/usr/local/lib/python2.7/site-packages WSGIProcessGroup bms WSGIScriptAliasMatch ^/adam(.*) /home/ajt1g09/bms/apache/django.wsgi WSGIScriptAlias / /home/user/bms/apache/django.wsgi </VirtualHost>
And also the django.wsgi file in ajt1g09/bms/apache:
import os import sys path = '/home/ajt1g09/bms' if path not in sys.path: sys.path.append(path) sys.path.append('/usr/local/lib/python2.7/site-packages') sys.path.append('/home/ajt1g09') os.environ['DJANGO_SETTINGS_MODULE'] = 'bms.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
And lastly, the web addresses.py file in ajt1g09/bms (clearly showing /admin can there be):
from django.conf.web addresses.defaults import designs, include, url
#Uncomment the following two lines make it possible for the admin: from django.contrib import admin admin.autodiscover()
urlpatterns = designs('', # Good examples: # url(r'^$', 'bms.sights.home', title='home'), # url(r'^bms/', include('bms.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation: url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: url(r'^admin/', include(admin.site.urls)), )
I've no clue what the issue is.
You should not be utilising:
WSGIScriptAliasMatch ^/adam(.*) /home/ajt1g09/bms/apache/django.wsgi
WSGIScriptAlias /adam /home/ajt1g09/bms/apache/django.wsgi
The WSGIScriptAliasMatch won't act as written since you haven't re replaced the matched up part from back to last argument. Ie.,
WSGIScriptAliasMatch ^/adam(.*) /home/ajt1g09/bms/apache/django.wsgi$1
You need to though not be utilising WSGIScriptAliasMatch. That's for advanced use cases only as well as you be cautious in making use of it because the way you utilize it could affect what SCRIPT_Title/PATH_INFO are going to when passed to application which is individuals that web addresses.py matching relies off.