#10809: mod_wsgi authentication handler
---------------------------------------------+------------------------------
Reporter: baumer1122 | Owner: nobody
Status: new | 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 davidfischer):
Graham. I understand that the `DJANGO_SETTINGS_MODULE` can be set from
inside an external mod_wsgi auth script as it is in the
[http://code.google.com/p/modwsgi/wiki/AccessControlMechanisms mod_wsgi
docs]. However, this ticket is about putting a generic mod_wsgi auth
handler into the Django code line. A generic handler would need to somehow
set `DJANGO_SETTINGS_MODULE` and possibly the Python path. The
[http://code.djangoproject.com/browser/django/trunk/django/contrib/auth/handlers/modpython.py
mod_python handler], for example, must set `DJANGO_SETTINGS_MODULE` into
`os.environ` before
{{{
from django.contrib.auth.models import User
}}}
A generic mod_wsgi handler would probably need to do something similar,
but I'm not sure that's possible. Ideally, I think that the functionality
and setup of a mod_wsgi auth handler should be very close to
[http://docs.djangoproject.com/en/1.0/howto/apache-auth/ that] of the
mod_python auth handler. Ideally, using a mod_wsgi auth handler would be
as easy as:
{{{
<Location "/">
AuthType Basic
AuthName "wsgi protected"
Require valid-user
# maybe set DJANGO_SETTINGS_MODULE here somehow
AuthBasicProvider wsgi
WSGIAuthUserScript django.contrib.auth.handlers.modwsgi
</Location>
}}}
Maintaining an extra custom auth script works fine (I'm using it), but it
seems like everybody who uses Django/mod_wsgi authentication is going to
have the same auth script with only the `DJANGO_SETTINGS_MODULE` changed.
Some abstraction might be nice.
By the way, mod_wsgi is great! I'm a big fan and I'm not trying to put it
down.
--
Ticket URL: <http://code.djangoproject.com/ticket/10809#comment:7>
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
-~----------~----~----~----~------~----~------~--~---