On 9/19/07, tonybanjo <[EMAIL PROTECTED]> wrote:
>
> I'm configuring a new server that needs to run a standard website
> alongside a Django application. Everything is installed correctly but
> browsing to the site goes straight to the Django app, I can't see the
> main site at all as it seems Django takes over.
>
> What I'd like to do is have a URL like this;
>
> http://www.mysite.com - the main website and this for the Django app;
>
> http://register.mysite.com
>
> The Apache config is default except for this added in the virtual
> sites section at the end of httpd.conf;
>
> <VirtualHost *:80>
> # edit if changed
> ServerName garritan.centos
> AcceptPathInfo Off
> <Location />
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE garritan.settings
> SetEnv LD_LIBRARY_PATH /usr/lib:/usr/pgsql/lib
> PythonDebug On
>
> # edit if paths change:
> PythonPath "['/opt/'] + sys.path"
> </Location>
>
> # edit if paths change
> Alias /media /opt/garritan/media
>
> # this says, for static content, use apache
> <Location /media>
> SetHandler None
> Satisfy Any
> Allow from All
> </Location>
> </VirtualHost>
>
> I have tested it by running the Django app on another port and this
> works fine but it isn't how I want it to work. Any help on this would
> be greatly appreciated.
>
> Tony
I've done this in the past by using a LocationMatch directive instead
of Location, as I had existing PHP applications which were also in use
on the same server:
<LocationMatch "^/(admin|release_archive)/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE projects.settings
</LocationMatch>
It helped that the Django app I was running had all its URLs mapped to
start with "release_archive".
Jonathan.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---