Open GoogleCodeExporter opened 8 years ago
I think it would be useful. It would be great if you submitted your patches.
Original comment by dherbst
on 10 Jul 2010 at 6:58
patches are always welcome. Reducing the amount that need to be monkey patched
at start-up is always a worthy goal. If you can send a series of small, easy to
review changes to do this in a way that is easy to review we'll be happy to
consider them.
Original comment by m...@google.com
on 12 Jul 2010 at 9:07
Here's two patches that enable support for django authentication.
The first one, PlugableAuth.diff, changes the Monkeypatcher to load user models
from the settings variable AUTH_USER_MODULE (if empty it will default on
'appengine_django.auth.models')
It also change the authentication middleware name from AuthenticationMiddleware
to GoogleAuthenticationMiddleware (I feel it is less confusing). There is no
monkey patching required to load the middleware (this was removed) in can be
done by using the MIDDLEWARE_CLASSES tuple in the settings file. So if you want
to enable Google authentication, you need to add
'appengine_django.auth.middleware.DjangoAuthenticationMiddleware' to the
MIDDLEWARE_CLASSES (on top of what was previously needed).
The second one, DjangoAuth.diff adds a Django User model that is compatible
with GAE and Django authentication. The necessary models are in
auth/django_models. It also provide an appropriate authentication backend in
auth/backends and adds a Django compatible middleware in auth/middlewares.
To enable the django authentication, in the settings file:
1. uncomment/put the following modules in the MIDDLEWARE_CLASSES tuple:
'django.contrib.sessions.middleware.SessionMiddleware',
'appengine_django.auth.middleware.DjangoAuthenticationMiddleware',
2. Set the AUTHENTICATION_BACKENDS tuple to
('appengine_django.auth.backends.ModelBackend',)
3. Set AUTH_USER_MODULE string to:
'appengine_django.auth.django_models'
Finally put the urls mapping to the login/logout views according to the Django
documentation or by providing your own override.
Original comment by sebastie...@gmail.com
on 14 Jul 2010 at 8:18
Attachments:
Sorry for delay, I'll do my best to review these ASAP.
Original comment by m...@google.com
on 26 Oct 2010 at 12:35
This looks reasonable. I'm not terribly familiar with how applications use the
Django authentication functionality though. It would be helpful if a couple of
other interested parties could speak up and confirm that the approach here is
generally useful to all applications.
Finally, please confirm that you have signed and agreed to the CLA as described
in the readme.
Thanks for your contribution.
Original comment by m...@google.com
on 18 Nov 2010 at 7:04
Original issue reported on code.google.com by
sebastie...@gmail.com
on 10 Jul 2010 at 2:16