Actually the mod_wsgi version isn't going to matter. Had forgot that the 
default behaviour is something that just can't be changed and it actually 
mirrors how Alias in Apache works.

There are couple of ways to achieve what you want. The first is that instead of:

    WSGIScriptAlias / /Users/graham/Projects/mod_wsgi/tests/environ.wsgi

you use:

    WSGIScriptAliasMatch "^/([^~].*)?$" 
/Users/graham/Projects/mod_wsgi/tests/environ.wsgi/$1

The second way is bit more convoluted and involves use of mod_rewrite, a 
DocumentRoot directory and fiddling stuff in the WSGI application script file. 
Lets see though whether the first way suffices.

What that WSGIScriptAliasMatch does is to pass through anything that doesn't 
start with '/~' to the WSGI application.

Very import is how the matched URL is added back to the target WSGI script file 
provided as last argument. If you don't do that then SCRIPT_NAME/PATH_INFO will 
not be constructed in way required.

Graham

> On 7 Jan 2017, at 4:41 PM, Graham Dumpleton <[email protected]> 
> wrote:
> 
> What mod_wsgi version are you using?
> 
> Graham
> 
>> On 7 Jan 2017, at 2:33 PM, Cristian P <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> Hi 
>> 
>> I have a spent week looking online on how to make userdir module 
>> (www.example.com/~username <http://www.example.com/~username>) work when 
>> the root page is a wsgi application (WSGIScriptAlias / /path/to/wsgi.py).
>> 
>> I am using Django (1.10.4) with on Apache (2.4.18) with mod-wsgi enabled. 
>> 
>> I have read multiple post written by Graham addressing this but I can't 
>> wrapped my head on how I would 
>> implemented as I am just getting started in web development.
>> I am trying to let apache handle all userdir pages with no wsgi capabilities 
>> and if possible a set of list of other sub urls 
>> should be handle by apache and bypass wsgi.
>> 
>> I have seen posts that suggest changes to the wsgiscript but all the post 
>> involve an application method which is not implemented
>> when using the django supply script
>> 
>> The wsgi.py is :
>> """
>> WSGI config for website project.
>> It exposes the WSGI callable as a module-level variable named 
>> ``application``.
>> For more information on this file, see
>> https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ 
>> <https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/>
>> """
>> import os
>> from django.core.wsgi import get_wsgi_application
>> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "website.settings")
>> application = get_wsgi_application()
>> 
>> Thank you any help would be greatly appreciated
>> Cristian
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "modwsgi" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] 
>> <mailto:[email protected]>.
>> To post to this group, send email to [email protected] 
>> <mailto:[email protected]>.
>> Visit this group at https://groups.google.com/group/modwsgi 
>> <https://groups.google.com/group/modwsgi>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to