Re: non-root SCRIPT_NAME, mod_wsgi and RewriteRule

2012-10-05 Thread Sebastiaan Snoeckx


> I have my Django website and my static files deployed under the same 
>> directory (i.e. no separate 'static' directory), according to the following 
>> Apache RewriteRule:
>>
>> RewriteEngine on
>> RewriteCond %{DOCUMENT_ROOT}%{REQUEST_**FILENAME} !-d
>> RewriteCond %{DOCUMENT_ROOT}%{REQUEST_**FILENAME} !-f
>> RewriteRule ^.*$ /django/$1  [QSA,PT,L]
>>
>> WSGIScriptAlias /django/ /var/www/domain.com/django/**
>> site/wsgi.py 
>>
>> My site-wide urlconf looks like this:
>>
>> urlpatterns = patterns('',
>> url(r'^blog/', include('blog.urls')),
>> url(r'', include('home.urls')),
>> )
>>
>> With my app-specific urlconf ('home.urls') is simply this:
>>
>> urlpatterns = patterns('home.views',
>> url(r'^(?P[a-z0-9-]+)/?$'**, 'page_by_uri'),
>> url(r'^$', 'index'),
>> )
>>
>> So when I visit my site domain.com I should see the index view (which it 
>> does), and when I visit domain.com/foo I should see the 
>> page_by_uri('foo') view, *which it doesn't*. Instead, it shows the index 
>> view. (And I thought it should give an error!)
>>
>> Having surfed around a little bit, I reckon it's got something to do with 
>> Django's handling of SCRIPT_NAME (which should be equal to the mount point, 
>> in my case '/dj'). Various solutions are proposed, generally involving 
>> adding the mount point to my urlconf (bad!) until I tried it and it doesn't 
>> even work...
>>
>> Basically, how in the name of all that is holy and sacred can I get this 
>> to work?!
>>
>> Thanks in advance
>>
>> is it a problem with the trailing slash?
>
>
That's a typo, it should read "WSGIScriptAlias /django 
/var/www/domain.com/django/site/wsgi.py", still, it doesn't work as it's 
supposed to. What am I doing wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/5nz0XcpUVBgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: non-root SCRIPT_NAME, mod_wsgi and RewriteRule

2012-10-01 Thread m1chael
is it a problem with the trailing slash?

On Sun, Sep 30, 2012 at 7:57 AM, Sebastiaan Snoeckx <
sebastiaan.snoe...@gmail.com> wrote:

> I have my Django website and my static files deployed under the same
> directory (i.e. no separate 'static' directory), according to the following
> Apache RewriteRule:
>
> RewriteEngine on
> RewriteCond %{DOCUMENT_ROOT}%{REQUEST_**FILENAME} !-d
> RewriteCond %{DOCUMENT_ROOT}%{REQUEST_**FILENAME} !-f
> RewriteRule ^.*$ /django/$1  [QSA,PT,L]
>
> WSGIScriptAlias /django/ 
> /var/www/domain.com/django/**site/wsgi.py
>
> My site-wide urlconf looks like this:
>
> urlpatterns = patterns('',
> url(r'^blog/', include('blog.urls')),
> url(r'', include('home.urls')),
> )
>
> With my app-specific urlconf ('home.urls') is simply this:
>
> urlpatterns = patterns('home.views',
> url(r'^(?P[a-z0-9-]+)/?$'**, 'page_by_uri'),
> url(r'^$', 'index'),
> )
>
> So when I visit my site domain.com I should see the index view (which it
> does), and when I visit domain.com/foo I should see the
> page_by_uri('foo') view, *which it doesn't*. Instead, it shows the index
> view. (And I thought it should give an error!)
>
> Having surfed around a little bit, I reckon it's got something to do with
> Django's handling of SCRIPT_NAME (which should be equal to the mount point,
> in my case '/dj'). Various solutions are proposed, generally involving
> adding the mount point to my urlconf (bad!) until I tried it and it doesn't
> even work...
>
> Basically, how in the name of all that is holy and sacred can I get this
> to work?!
>
> Thanks in advance
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



non-root SCRIPT_NAME, mod_wsgi and RewriteRule

2012-09-30 Thread Sebastiaan Snoeckx
I have my Django website and my static files deployed under the same 
directory (i.e. no separate 'static' directory), according to the 
following Apache RewriteRule:


RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteRule ^.*$ /django/$1  [QSA,PT,L]

WSGIScriptAlias /django/ /var/www/domain.com/django/site/wsgi.py

My site-wide urlconf looks like this:

urlpatterns = patterns('',
url(r'^blog/', include('blog.urls')),
url(r'', include('home.urls')),
)

With my app-specific urlconf ('home.urls') is simply this:

urlpatterns = patterns('home.views',
url(r'^(?P[a-z0-9-]+)/?$', 'page_by_uri'),
url(r'^$', 'index'),
)

So when I visit my site domain.com I should see the index view (which it 
does), and when I visit domain.com/foo I should see the 
page_by_uri('foo') view, *which it doesn't*. Instead, it shows the index 
view. (And I thought it should give an error!)


Having surfed around a little bit, I reckon it's got something to do 
with Django's handling of SCRIPT_NAME (which should be equal to the 
mount point, in my case '/dj'). Various solutions are proposed, 
generally involving adding the mount point to my urlconf (bad!) until I 
tried it and it doesn't even work...


Basically, how in the name of all that is holy and sacred can I get this 
to work?!


Thanks in advance



smime.p7s
Description: S/MIME Cryptographic Signature