Thanks Jeff for this tip. When I explicitly do "from django.conf
import settings' it seems to print the AUTHETICATION_BACKENDS. Looks
like if I do not do explicit import- I can print the
AUTHENTICATION_BACKENDS.

Python 2.4.3 (#1, Oct 23 2006, 14:19:45)
[GCC 4.1.1 20060525 (Red Hat 4.1.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.conf import settings
>>> settings.AUTHENTICATION_BACKENDS
'reviewboard.accounts.backends.LDAPBackend'


(InteractiveConsole)
>>> settings.AUTHENTICATION_BACKENDS
Traceback (most recent call last):
  File "<console>", line 1, in ?
NameError: name 'settings' is not defined

manage.py is already doing the import right?
try:
     import settings # Assumed to be in the same directory.

when I changed that line to

try:
#     import settings # Assumed to be in the same directory.
    from django.conf import settings # Assumed to be in the same
directory.

I get the following error.

Traceback (most recent call last):
  File "manage.py", line 121, in ?
    if settings.DEBUG:
  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py",
line 28, in __getattr__
    self._import_settings()
  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py",
line 57, in _import_settings
    raise ImportError("Settings cannot be imported, because
environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefined.

I set an environment variable -

 setenv DJANGO_SETTINGS_MODULE django.conf

Still the same issue.

What am I doing wrong?

Thanks



On Jun 27, 10:29 am, Jeff Anderson <[EMAIL PROTECTED]> wrote:
> satish wrote:
> > Hi Jeff,
>
> > Thanks for helping me out here.
>
> > I did enable logging on the LDAP server. Looks like the requests are
> > not going to the LDAP server. I removed backends.pyc. When I run the
> > server the next time, it should have generated the backends.pyc right?
> > I also removed django.contrib.auth.backends.ModelBackend.pyc- which is
> > not getting re-generated as well.  Any thoughts?
>
> Well, I still don't know exactly what is going wrong...
> When you attempt to authenticate, what exactly happens? Do you get a
> "bad username/password" when you try to log in?
>
> Is 'settings_local.py' even being used? Usually the settings module is
> 'settings.py'. Do you have one of those as well? I've never had any
> problem with the patch from #2507 for ldap auth. Is that what you are
> using? I put the authentication_backends and ldap-specific settings into
> my settings.py
>
> Try this:
>
>     $ python manage.py shell
>     >>> from django.conf import settings
>     >>> settings.AUTHENTICATION_BACKENDS
>     ('reviewboard.accounts.backends.LDAPBackend',)
>
> (to make sure it is in fact set correctly)
>
> Jeff Anderson
>
>  signature.asc
> 1KDownload
--~--~---------~--~----~------------~-------~--~----~
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