1

I have apache set up on my local machine to serve some django projects. I am trying to develop another site that is not a django site. When I try to look at the non-django site, apache tries to interpret its url through django, and gives an error that the url does not match any patterns in urls.py.

I can see the non-django site by commenting out the django-specific parts of httpd.conf and restarting apache. But I know there is a way to tell apache not to try to interpret certain urls through django, or to only interpret certain urls through django.

I think the relevant parts of my setup are:

  • All django projects are in /srv/python-environments/env_name/django_project_name
  • All non-django sites are in /var/www/site_name
  • The non-django sites consist of static html files, a wordpress blog, and a few simple (non-django) python scripts.

  • I think I have set up all localhost urls to be interpreted as django urls through this line in httpd.conf, but I can't figure out how to change it:

    WSGIScriptAlias / /srv/python-environments/phs_comp_env/phs_competencies/apache/django.wsgi

  • I am running ubuntu 10.04, apache 2.2, django through mod_wsgi.

What do I need to change, or what other information do I need to provide?

For the record, this is what worked. I placed the non-django site configuration before the django site configuration:

Alias /non-django_site/ /var/www/non-django_site/
<Directory /var/www/non-django_site>
Options +ExecCGI
AddHandler cgi-script .py
</Directory> 
0

1 Answer 1

1

You don't provide enough information about the other non Python web application. One can only guess you are talking about PHP. Read:

http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive

Use the AddHandler method of mapping WSGI application and especially the solution towards the end of that section of the documentation.

Sign up to request clarification or add additional context in comments.

1 Comment

I ended up placing the directives for the non-django sites first in httpd.conf, and used Alias settings for the non-django sites. Your question about php helped my searching, even though I am not using php. Rather than search something like "apache host django and non-django" I searched "apache host django and php", and "apache host multiple django sites". These searches led to much more useful resources than I was finding. Thank you for the lead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.