0

Right now, my http://localhost/ address for all of my php sites (which are in my Sites folder).

However, my django sites will be in my /Users/myusername/djcode/www/ folder.

How do I see my django sites through typing http://localhost/django/ but still see my php sites when I go to http://localhost/...is this possible? Even a different port would be great, I just would like to see both sites.

redconservatory
  • 101
  • 1
  • 6

2 Answers2

1

Use the Alias directive

Something like

Alias /django /Users/myusername/djcode/www/

in your virtual host configuration

billc.cn
  • 454
  • 1
  • 5
  • 12
0

Follow the normal mod_wsgi setup instructions for Django with exception that you will mount your Django application at a sub URL and not at the root of the web site. See:

http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango

Where it gives as example:

WSGIScriptAlias / /usr/local/django/mysite/apache/django.wsgi

you will instead use:

WSGIScriptAlias /django /usr/local/django/mysite/apache/django.wsgi

Just remember to change '/usr/local/django/mysite' to where you have actually put the Django site and WSGI script file for your Django site. This applies to the Directory directive in the configuration as well that documentation says to create.

Also watch:

http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Conference_Presentations

to find out why you get various errors due to not following what the documentation says plus other file system permissions issues.

Graham Dumpleton
  • 6,090
  • 2
  • 21
  • 19