#10809: mod_wsgi authentication handler
---------------------------------------------+------------------------------
Reporter: baumer1122 | Owner: davidfischer
Status: assigned | Milestone:
Component: Authentication | Version: SVN
Resolution: | Keywords: mod_wsgi
Stage: Design decision needed | Has_patch: 1
Needs_docs: 1 | Needs_tests: 0
Needs_better_patch: 1 |
---------------------------------------------+------------------------------
Comment (by grahamd):
Presuming there is a corresponding Django application running in same
process/sub interpreter, a better way is have all the following in single
WSGI script file:
{{{
import sys
sys.path.append(...)
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django.contrib.auth.handlers.modwsgi
def check_password(environ, user, password):
return django.contrib.auth.handlers.modwsgi.check_password(environ,
user, password)
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
}}}
That is, no need to actually have multiple script files. Apache
configuration would then be:
{{{
AuthType Basic
AuthName "Top Secret"
AuthBasicProvider wsgi
Require valid-user
WSGIProcessGroup %{GLOBAL}
WSGIApplicationGroup django
WSGIAuthUserScript /usr/local/django/mysite/apache/django.wsgi
WSGIScriptAlias / /usr/local/django/mysite/apache/django.wsgi
}}}
The WSGIProcessGroup/WSGIApplicationGroup are to ensure both are executed
in same sub interpreter as by default authentication handler will execute
in %{GLOBAL} application group where as Django will be in group named
based on virtual host ServerName and application mount point.
--
Ticket URL: <http://code.djangoproject.com/ticket/10809#comment:12>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---