1

I'm trying to set up an apache + mod_wsgi environment for a Django site on Linux Mint. I followed the django site tutorial for this, and mod_wsgi site too. So far I got this:

on my httpd.conf I have this:

WSGIScriptAlias /site /path/to/wsgi_scripts/django.wsgi <Directory /path/to/wsgi_scripts> Order deny,allow Allow from all </Directory> 

in site.urls I have this:

urlpatterns = patterns('', (r'^site/', include('app.urls')), ) 

So, if I try to access the url localhost/site/index, it shows django view for a non-exists url, but, if I access localhost/site/site/index, it works fine.

My question is, which is the way to rid off the first "site" and that the application uses the urls from the alias that I'm using in the httpd.conf. Also, it works if I use the alias in the httpd.conf like this

WSGIScriptAlias / /path/to/wsgi_scripts/django.wsgi 

but I don't want to use it in this way. Suggestions?

Thanks in advance

1
  • "So, if I try to access the url localhost/site/index, it shows django view for a non-exists url, but, if I access localhost/site/site/index, it works fines." sounds like you need to change r'^site/' to r'^site' (remove the trailing slash) Commented Mar 22, 2011 at 1:30

1 Answer 1

1

The WSGIScriptAlias to /site is effectively making http://localhost/site/ the root for your Django app. Either set your configuration in httpd.conf to be:

WSGIScriptAlias / /path/to/wsgi_scripts/django.wsgi 

or your urls.py in your Django app to be

urlpatterns = patterns('', (r'', include('app.urls')), ) 
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.