Robin Becker wrote on 06/28/07 19:44:
> Steven Armstrong wrote:
>> Robin Becker wrote on 06/28/07 16:13:
>>> I see from this documentation
>>>
>>> http://www.djangoproject.com/documentation/apache_auth/#configuring-apache
>>>
>>> that it is conceptually possible to configure apache authorization using 
>>> django.
>>>
>>> However, we have recently decided to de-couple django from mod_python by 
>>> using 
>>> fastcgi. This is because we wish to allow our django apps to use which ever 
>>> python might be appropriate and not restrict to the one for which we have 
>>> compiled apache+mod_python.
>>>
>>> Is there any way to have mod_python stuck on Python-2.4 with the 
>>> controlling 
>>> django app use Python-2.5 and do configuration for apache. The only way I 
>>> can 
>>> think of is to create a stub project which runs the auth only.
>>>
>>> I know that theoretically we can advance the apache, but that implies 
>>> re-installing wikis etc etc etc and when Python-2.6 comes out and the boss 
>>> wants 
>>> to use new feature X we'll go through the whole process again.
>>>
>>> Alternatively is there a way to do the reverse ie get django to use a 
>>> database 
>>> controlled by apache?
>> You could directly access the database using something like 
>> mod_auth_mysql or the like. But the way django stores passwords may be a 
>> problem.
>   yes it seems harder than setting up a dummy project.
> 
> On the other hand our current scheme uses require group xxx and I cannot seem 
> to 
>   get validation done that way.
> 
> I have this in a .htaccess file
> 
> AuthType basic
> AuthName "djauth test"
> Require valid-user
> Require group XXX
> SetEnv DJANGO_SETTINGS_MODULE djauth.settings
> PythonOption DJANGO_SETTINGS_MODULE djauth.settings
> PythonAuthenHandler django.contrib.auth.handlers.modpython
> 
> 
> I see the request for a user, but the validation seems to ignore the Require 
> Group clause entirely.

I don't think the 'Require group' stuff will work. Guess you'll have to 
write your own auth handler based on django.contrib.auth.handlers.modpython.

You could then pass the groups, or whatever else you need, to the 
handler using PythonOption directives.

e.g.

AuthType basic
AuthName "djauth test"
Require valid-user
SetEnv DJANGO_SETTINGS_MODULE djauth.settings
PythonOption DjangoGroups XXX group2 group3
PythonAuthenHandler path.to.my.auth.handler

Have a look at django.contrib.auth.handlers.modpython.
Should be easy to do.

Good luck.


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to