Your working path is shown in the debug output: /usr/local/lib/python2.6/dist-packages/baruwa-1.1.2-py2.6.egg
And 'ad.py' should be located at: /usr/local/lib/python2.6/dist-packages/baruwa-1.1.2-py2.6.egg/baruwa/auth/ad.py It doesn't look like ad.py has been updated if you're still receiving that error... The edits to ad.py will force the use of settings.py values when no AD hosts are defined in MySQL table auth_domain... -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Frederik Vande Rieviere Sent: Wednesday, April 10, 2013 9:56 AM To: Baruwa users list Subject: Re: [Baruwa] question concerning AD authentication Can you also let me know what the default installation path of ad.py is when installing from git? I have multiple files sitting on my system now which is a tad annoying because its not very clear to me which ones are used. > Can you post debug output again, particularly if it *is* different? I was > able to replicate the problem regarding the error 'MailADAuthHost matching > query does not exist' and confirmed it was fixed by the changes made to > ad.py... I want to make sure you're not receiving a new error. Here you go : DoesNotExist at /accounts/login/ MailADAuthHost matching query does not exist. Request Method: POST Request URL: http://mailscanner.domain.com/accounts/login/ Django Version: 1.2.3 Exception Type: DoesNotExist Exception Value: MailADAuthHost matching query does not exist. Exception Location: /usr/lib/pymodules/python2.6/django/db/models/query.py in get, line 341 Python Executable: /usr/bin/python Python Version: 2.6.6 Python Path: ['/usr/local/lib/python2.6/dist-packages/baruwa-1.1.2-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/python_dateutil-1.5-py2.6.egg', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/local/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL'] Server time: Wed, 10 Apr 2013 15:44:00 +0200 Traceback Switch to copy-and-paste view /usr/lib/pymodules/python2.6/django/core/handlers/base.py in get_response response = callback(request, *callback_args, **callback_kwargs) ... ▶ Local vars /usr/local/lib/python2.6/dist-packages/baruwa-1.1.2-py2.6.egg/baruwa/accounts/views.py in local_login if form.is_valid(): ... ▶ Local vars /usr/lib/pymodules/python2.6/django/forms/forms.py in is_valid return self.is_bound and not bool(self.errors) ... ▶ Local vars /usr/lib/pymodules/python2.6/django/forms/forms.py in _get_errors self.full_clean() ... ▶ Local vars /usr/lib/pymodules/python2.6/django/forms/forms.py in full_clean self._clean_form() ... ▶ Local vars /usr/lib/pymodules/python2.6/django/forms/forms.py in _clean_form self.cleaned_data = self.clean() ... ▶ Local vars /usr/lib/pymodules/python2.6/django/contrib/auth/forms.py in clean self.user_cache = authenticate(username=username, password=password) ... ▶ Local vars /usr/lib/pymodules/python2.6/django/contrib/auth/__init__.py in authenticate user = backend.authenticate(**credentials) ... ▶ Local vars /usr/local/lib/python2.6/dist-packages/baruwa-1.1.2-py2.6.egg/baruwa/auth/ad.py in authenticate adset = MailADAuthHost.objects.get(ad_host=host) ... ▶ Local vars /usr/lib/pymodules/python2.6/django/db/models/manager.py in get return self.get_query_set().get(*args, **kwargs) ... ▶ Local vars /usr/lib/pymodules/python2.6/django/db/models/query.py in get % self.model._meta.object_name) ... ▶ Local vars Request information GET No GET data POST Variable Value username u'[email protected]' csrfmiddlewaretoken u'cr4zyt0k3n123' password u'mypasswd' language u'en' next u'/' FILES No FILES data COOKIES Variable Value csrftoken 'cr4zyt0k3n123' sessionid 'cr4zyt0k3n123' META Variable Value CONTENT_LENGTH '117' CONTENT_TYPE 'application/x-www-form-urlencoded' CSRF_COOKIE 'cr4zyt0k3n123' DOCUMENT_ROOT '/etc/apache2/htdocs' GATEWAY_INTERFACE 'CGI/1.1' HTTP_ACCEPT 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' HTTP_ACCEPT_ENCODING 'gzip, deflate' HTTP_ACCEPT_LANGUAGE 'nl,en-us;q=0.7,en;q=0.3' HTTP_CONNECTION 'keep-alive' HTTP_COOKIE 'csrftoken=cr4zyt0k3n123; sessionid=cr4zyt0k3n123' HTTP_DNT '1' HTTP_HOST 'mailscanner.domain.com' HTTP_REFERER 'http://mailscanner.domain.com/accounts/login/?next=/' HTTP_USER_AGENT 'Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0' PATH_INFO u'/accounts/login/' PATH_TRANSLATED '/usr/share/pyshared/baruwa/baruwa.wsgi/accounts/login/' PYTHON_EGG_CACHE '/var/tmp' QUERY_STRING '' REMOTE_ADDR 'myipaddy' REMOTE_PORT '61112' REQUEST_METHOD 'POST' REQUEST_URI '/accounts/login/' SCRIPT_FILENAME '/usr/share/pyshared/baruwa/baruwa.wsgi' SCRIPT_NAME u'' SERVER_ADDR 'serveripaddy' SERVER_ADMIN '[no address given]' SERVER_NAME 'mailscanner.domain.com' SERVER_PORT '80' SERVER_PROTOCOL 'HTTP/1.1' SERVER_SIGNATURE '<address>Apache/2.2.16 (Debian) Server at mailscanner.domain.com Port 80</address>\n' SERVER_SOFTWARE 'Apache/2.2.16 (Debian)' mod_wsgi.application_group 'mailscan.domain.com|' mod_wsgi.callable_object 'application' mod_wsgi.handler_script '' mod_wsgi.input_chunked '0' mod_wsgi.listener_host '' mod_wsgi.listener_port '80' mod_wsgi.process_group '' mod_wsgi.request_handler 'wsgi-script' mod_wsgi.script_reloading '1' mod_wsgi.version (3, 3) wsgi.errors <mod_wsgi.Log object at 0xb86924f8> wsgi.file_wrapper <built-in method file_wrapper of mod_wsgi.Adapter object at 0xb896cf08> wsgi.input <mod_wsgi.Input object at 0xb8692200> wsgi.multiprocess True wsgi.multithread True wsgi.run_once False wsgi.url_scheme 'http' wsgi.version (1, 1) Settings Using settings module baruwa.settings Setting Value ABSOLUTE_URL_OVERRIDES {} ADMINS () ADMIN_FOR () ADMIN_MEDIA_PREFIX '/media/' AD_ADMIN_GROUP 'Administrators' AD_HOST_NAME 'myauthserver.domain.com' AD_LDAP_PORT 389 AD_LDAP_SCHEME 'ldap://' AD_LOG_FILE '/var/log/baruwa/baruwa-ldap.log' AD_SEARCH_DN 'dc=domain, dc=com' AD_SEARCH_FIELDS ['mail', 'givenName', 'sn', 'SAMAccountName', 'memberOf', 'dn'] AD_USER_GROUP 'MailUsers' ALLOWED_HOSTS ['*'] ALLOWED_INCLUDE_ROOTS () APPEND_SLASH True AUTHENTICATION_BACKENDS ('baruwa.auth.backends.MailBackend', 'django.contrib.auth.backends.ModelBackend', 'baruwa.auth.ad.ActiveDirectoryBackend') AUTH_PROFILE_MODULE 'accounts.userprofile' BANNED_IPS () BROKER_HOST 'localhost' BROKER_PASSWORD '********************' BROKER_PORT 5672 BROKER_USER 'baruwa' BROKER_VHOST 'baruwa' CACHE_BACKEND 'locmem://' CACHE_MIDDLEWARE_KEY_PREFIX '' CACHE_MIDDLEWARE_SECONDS 600 CELERY_CONCURRENCY 20 CELERY_DEFAULT_EXCHANGE 'default' CELERY_DEFAULT_EXCHANGE_TYPE 'direct' CELERY_DEFAULT_QUEUE 'default' CELERY_DEFAULT_ROUTING_KEY 'default' CELERY_DISABLE_RATE_LIMITS True CELERY_QUEUES {'default': {'binding_key': 'default', 'exchange': 'default'}, 'mailscan': {'binding_key': 'mailscan', 'exchange_type': 'direct'}} CELERY_RESULT_BACKEND 'database' COMMENTS_ALLOW_PROFANITIES False COMMENTS_BANNED_USERS_GROUP None COMMENTS_FIRST_FEW 0 COMMENTS_MODERATORS_GROUP None COMMENTS_SKETCHY_USERS_GROUP None CSRF_COOKIE_DOMAIN None CSRF_COOKIE_NAME 'csrftoken' CSRF_FAILURE_VIEW 'django.views.csrf.csrf_failure' CURRENT_PATH u'/usr/local/lib/python2.6/dist-packages/baruwa-1.1.2-py2.6.egg/baruwa' DATABASES {'default': {'ENGINE': 'django.db.backends.mysql', 'HOST': 'localhost', 'NAME': 'baruwa', 'OPTIONS': {'init_command': 'SET storage_engine=INNODB, SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;'}, 'PASSWORD': '********************', 'PORT': '', 'TEST_CHARSET': None, 'TEST_COLLATION': None, 'TEST_MIRROR': None, 'TEST_NAME': None, 'TIME_ZONE': 'Africa/Johannesburg', 'USER': 'baruwa'}} DATABASE_ENGINE '' DATABASE_HOST '' DATABASE_NAME '' DATABASE_OPTIONS {} DATABASE_PASSWORD '********************' DATABASE_PORT '' DATABASE_ROUTERS [] DATABASE_USER '' DATETIME_FORMAT 'N j, Y, P' DATETIME_INPUT_FORMATS ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M', '%Y-%m-%d', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M', '%m/%d/%Y', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M', '%m/%d/%y') DATE_FORMAT 'N j, Y' DATE_INPUT_FORMATS ('%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y', '%b %d, %Y', '%d %b %Y', '%d %b, %Y', '%B %d %Y', '%B %d, %Y', '%d %B %Y', '%d %B, %Y') DEBUG True DEBUG_PROPAGATE_EXCEPTIONS False DECIMAL_SEPARATOR '.' DEFAULT_CHARSET 'utf-8' DEFAULT_CONTENT_TYPE 'text/html' DEFAULT_FILE_STORAGE 'django.core.files.storage.FileSystemStorage' DEFAULT_FROM_EMAIL '[email protected] ' DEFAULT_INDEX_TABLESPACE '' DEFAULT_TABLESPACE '' DISALLOWED_USER_AGENTS () EMAIL_BACKEND 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST 'localhost' EMAIL_HOST_PASSWORD '********************' EMAIL_HOST_USER '' EMAIL_PORT 25 EMAIL_SIGNATURES_DIR '********************' EMAIL_SUBJECT_PREFIX '[Django] ' EMAIL_USE_TLS False FILE_CHARSET 'utf-8' FILE_UPLOAD_HANDLERS ('django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler') FILE_UPLOAD_MAX_MEMORY_SIZE 2621440 FILE_UPLOAD_PERMISSIONS None FILE_UPLOAD_TEMP_DIR None FIRST_DAY_OF_WEEK 0 FIXTURE_DIRS () FORCE_SCRIPT_NAME None FORMAT_MODULE_PATH None GEOIP_IPV6_DB '/usr/share/GeoIP/GeoIPv6.dat' IGNORABLE_404_ENDS ('mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi', 'favicon.ico', '.php') IGNORABLE_404_STARTS ('/cgi-bin/', '/_vti_bin', '/_vti_inf') INSTALLED_APPS ['baruwa.fixups', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'baruwa.auth', 'baruwa.accounts', 'baruwa.messages', 'baruwa.lists', 'baruwa.reports', 'baruwa.status', 'baruwa.config', 'djcelery', 'south'] INTERNAL_IPS ('127.0.0.1',) LANGUAGES (('en', 'English'), ('af', 'Afrikaans'), ('it', 'Italian'), ('cs', 'Czech'), ('fr', 'French'), ('pl', 'Polish')) LANGUAGES_BIDI ('he', 'ar', 'fa') LANGUAGE_CODE 'en' LANGUAGE_COOKIE_NAME 'django_language' LOCALE_PATHS (u'/usr/local/lib/python2.6/dist-packages/baruwa-1.1.2-py2.6.egg/baruwa/locale',) LOGGING {'disable_existing_loggers': False, 'handlers': {'mail_admins': {'class': 'django.utils.log.AdminEmailHandler', 'level': 'ERROR'}}, 'loggers': {'django.request': {'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True}}, 'version': 1} LOGIN_REDIRECT_URL '/accounts/profile/' LOGIN_URL '/accounts/login/' LOGOUT_URL '/accounts/logout/' MANAGERS () MEDIA_ROOT u'/usr/local/lib/python2.6/dist-packages/baruwa-1.1.2-py2.6.egg/baruwa/static' MEDIA_URL '/static/' MESSAGE_STORAGE 'django.contrib.messages.storage.user_messages.LegacyFallbackStorage' MIDDLEWARE_CLASSES ('django.middleware.gzip.GZipMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware') MONTH_DAY_FORMAT 'F j' MS_CONFIG '/etc/MailScanner/MailScanner.conf' MS_QUICKPEEK '/usr/sbin/Quick.Peek' NUMBER_GROUPING 0 PASSWORD_RESET_TIMEOUT_DAYS '********************' PREPEND_WWW False PROFANITIES_LIST '********************' QUARANTINE_DAYS_TO_KEEP 60 QUARANTINE_REPORT_HOSTURL 'http://mailscanner.domain.com ' RADIUS_SECRET '********************' ROOT_URLCONF 'baruwa.urls' SA_RULES_DIRS ['/usr/share/spamassassin', '/etc/mail/spamassassin'] SECRET_KEY '********************' SEND_BROKEN_LINK_EMAILS False SERVER_EMAIL 'root@localhost' SESSION_COOKIE_AGE 28800 SESSION_COOKIE_DOMAIN None SESSION_COOKIE_NAME 'sessionid' SESSION_COOKIE_PATH '/' SESSION_COOKIE_SECURE False SESSION_ENGINE 'django.contrib.sessions.backends.db' SESSION_EXPIRE_AT_BROWSER_CLOSE True SESSION_FILE_PATH None SESSION_SAVE_EVERY_REQUEST False SETTINGS_MODULE 'baruwa.settings' SHORT_DATETIME_FORMAT 'm/d/Y P' SHORT_DATE_FORMAT 'm/d/Y' SITE_ID 1 SOUTH_AUTO_FREEZE_APP True TEMPLATE_CONTEXT_PROCESSORS ('django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.request', 'baruwa.utils.context_processors.status', 'baruwa.utils.context_processors.general') TEMPLATE_DEBUG True TEMPLATE_DIRS (u'/usr/local/lib/python2.6/dist-packages/baruwa-1.1.2-py2.6.egg/baruwa/templates',) TEMPLATE_LOADERS ('django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader') TEMPLATE_STRING_IF_INVALID '' TEST_DATABASE_CHARSET None TEST_DATABASE_COLLATION None TEST_DATABASE_NAME None TEST_RUNNER 'django.test.simple.DjangoTestSuiteRunner' THOUSAND_SEPARATOR ',' TIME_FORMAT 'P' TIME_INPUT_FORMATS ('%H:%M:%S', '%H:%M') TIME_ZONE 'Africa/Johannesburg' TRANSACTIONS_MANAGED False URL_VALIDATOR_USER_AGENT 'Django/1.2.3 (http://www.djangoproject.com)' USE_ETAGS False USE_I18N True USE_L10N True USE_THOUSAND_SEPARATOR False USE_X_FORWARDED_HOST False YEAR_MONTH_FORMAT 'F Y' _______________________________________________ Keep Baruwa FREE - http://pledgie.com/campaigns/12056 _______________________________________________ Keep Baruwa FREE - http://pledgie.com/campaigns/12056

