打开debug setting
http://wy:8888/address
AttributeError at /address/
'ModPythonRequest' object has no attribute 'user'
Request Method: GET
Request URL: http://wy:8888/address/
Exception Type: AttributeError
Exception Value: 'ModPythonRequest' object has no attribute 'user'
Exception Location: c:\python25\Lib\site-packages\django\core\context_processors.py in auth, line 18
Traceback (innermost last)
Switch to copy-and-paste view
* c:\python25\Lib\site-packages\django\core\handlers\base.py in get_response
70. # Apply view middleware
71. for middleware_method in self._view_middleware:
72. response = middleware_method(request, callback, callback_args, callback_kwargs)
73. if response:
74. return response
75.
76. try:
77. response = callback(request, *callback_args, **callback_kwargs) ...
78. except Exception, e:
79. # If the view raised an exception, run it through exception
80. # middleware, and if the exception middleware returns a
81. # response, use that. Otherwise, reraise the exception.
82. for middleware_method in self._exception_middleware:
83. response = middleware_method(request, e)
▶ Local vars
Variable Value
callback
<function object_list at 0x04D841F0>
callback_args
()
callback_kwargs
{'paginate_by': 10, 'queryset': [<Address: limodou>, <Address: abc>, <Address: bcd>, <Address: ass>, <Address: dfsdf>, <Address: sfas>, <Address: sfsd>, <Address: sfasfsfsfas>, <Address: sfqwras>, <Address: wrr>, <Address: oqwu>, <Address: qwer>, <Address: qwqwrer>, <Address: sfsafafas>, <Address: oqwer>, <Address: fafasf>, <Address: ewrqa>, <Address: sfafas>, <Address: aksdhf>, <Address: auf>, <Address: qwkehr>, <Address: qwle>, <Address: paspf>, <Address: sfadfkas>, <Address: qlerjq>, <Address: aosfdu>, <Address: alfj>, <Address: qlejr>, <Address: oasodf>, <Address: oasdfo>]}
debug
<module 'django.views.debug' from 'C:\Python25\lib\site-packages\django\views\debug.pyc'>
e
AttributeError("'ModPythonRequest' object has no attribute 'user'",)
exceptions
<module 'django.core.exceptions' from 'C:\Python25\lib\site-packages\django\core\exceptions.pyc'>
mail_admins
<function mail_admins at 0x04ACD170>
middleware_method
<bound method XViewMiddleware.process_view of <django.middleware.doc.XViewMiddleware object at 0x0506C070>>
request
<ModPythonRequest path:/address/, GET:<MultiValueDict: {}>, POST:<MultiValueDict: {}>, COOKIES:{'sessionid': '14108ed5a09b3c3b6a1d210d6c86703e'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0L, 'CONTENT_TYPE': None, 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'HTTP_ACCEPT_CHARSET': 'gb2312,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'zh-cn,zh;q=0.5', 'HTTP_CACHE_CONTROL': 'max-age=0', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'sessionid=14108ed5a09b3c3b6a1d210d6c86703e', 'HTTP_HOST': 'wy:8888', 'HTTP_KEEP_ALIVE': '300', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7', 'PATH_INFO': '/', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '192.168.1.92', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': None, 'SERVER_NAME': '192.168.0.92', 'SERVER_PORT': 8888, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>
resolver
<django.core.urlresolvers.RegexURLResolver object at 0x0506C130>
response
None
self
<django.core.handlers.modpython.ModPythonHandler object at 0x04A745D0>
settings
<django.conf.LazySettings object at 0x04A93AF0>
urlconf
'newtest.urls'
urlresolvers
<module 'django.core.urlresolvers' from 'C:\Python25\lib\site-packages\django\core\urlresolvers.pyc'>
* c:\python25\Lib\site-packages\django\views\generic\list_detail.py in object_list
63. 'page': page,
64. 'next': page + 1,
65. 'previous': page - 1,
66. 'last_on_page': paginator.last_on_page(page - 1),
67. 'first_on_page': paginator.first_on_page(page - 1),
68. 'pages': paginator.pages,
69. 'hits' : paginator.hits,
70. }, context_processors) ...
71. else:
72. c = RequestContext(request, {
73. '%s_list' % template_object_name: queryset,
74. 'is_paginated': False
75. }, context_processors)
76. if not allow_empty and len(queryset) == 0:
▶ Local vars
Variable Value
allow_empty
False
context_processors
None
extra_context
{}
mimetype
None
object_list
[<Address: limodou>, <Address: abc>, <Address: bcd>, <Address: ass>, <Address: dfsdf>, <Address: sfas>, <Address: sfsd>, <Address: sfasfsfsfas>, <Address: sfqwras>, <Address: wrr>]
page
1
paginate_by
10
paginator
<django.core.paginator.ObjectPaginator object at 0x050ACD70>
queryset
[<Address: limodou>, <Address: abc>, <Address: bcd>, <Address: ass>, <Address: dfsdf>, <Address: sfas>, <Address: sfsd>, <Address: sfasfsfsfas>, <Address: sfqwras>, <Address: wrr>, <Address: oqwu>, <Address: qwer>, <Address: qwqwrer>, <Address: sfsafafas>, <Address: oqwer>, <Address: fafasf>, <Address: ewrqa>, <Address: sfafas>, <Address: aksdhf>, <Address: auf>, <Address: qwkehr>, <Address: qwle>, <Address: paspf>, <Address: sfadfkas>, <Address: qlerjq>, <Address: aosfdu>, <Address: alfj>, <Address: qlejr>, <Address: oasodf>, <Address: oasdfo>]
request
<ModPythonRequest path:/address/, GET:<MultiValueDict: {}>, POST:<MultiValueDict: {}>, COOKIES:{'sessionid': '14108ed5a09b3c3b6a1d210d6c86703e'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0L, 'CONTENT_TYPE': None, 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'HTTP_ACCEPT_CHARSET': 'gb2312,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'zh-cn,zh;q=0.5', 'HTTP_CACHE_CONTROL': 'max-age=0', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'sessionid=14108ed5a09b3c3b6a1d210d6c86703e', 'HTTP_HOST': 'wy:8888', 'HTTP_KEEP_ALIVE': '300', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7', 'PATH_INFO': '/', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '192.168.1.92', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': None, 'SERVER_NAME': '192.168.0.92', 'SERVER_PORT': 8888, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>
template_loader
<module 'django.template.loader' from 'C:\Python25\lib\site-packages\django\template\loader.pyc'>
template_name
None
template_object_name
'object'
* c:\python25\Lib\site-packages\django\template\context.py in __init__
93. def __init__(self, request, dict=None, processors=None):
94. Context.__init__(self, dict)
95. if processors is None:
96. processors = ()
97. else:
98. processors = tuple(processors)
99. for processor in get_standard_processors() + processors:
100. self.update(processor(request)) ...
▶ Local vars
Variable Value
dict
{'first_on_page': 1, 'has_next': True, 'has_previous': False, 'hits': 30, 'is_paginated': True, 'last_on_page': 10, 'next': 2, 'object_list': [<Address: limodou>, <Address: abc>, <Address: bcd>, <Address: ass>, <Address: dfsdf>, <Address: sfas>, <Address: sfsd>, <Address: sfasfsfsfas>, <Address: sfqwras>, <Address: wrr>], 'page': 1, 'pages': 3, 'previous': 0, 'results_per_page': 10}
processor
<function auth at 0x04D845B0>
processors
()
request
<ModPythonRequest path:/address/, GET:<MultiValueDict: {}>, POST:<MultiValueDict: {}>, COOKIES:{'sessionid': '14108ed5a09b3c3b6a1d210d6c86703e'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0L, 'CONTENT_TYPE': None, 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'HTTP_ACCEPT_CHARSET': 'gb2312,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'zh-cn,zh;q=0.5', 'HTTP_CACHE_CONTROL': 'max-age=0', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'sessionid=14108ed5a09b3c3b6a1d210d6c86703e', 'HTTP_HOST': 'wy:8888', 'HTTP_KEEP_ALIVE': '300', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7', 'PATH_INFO': '/', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '192.168.1.92', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': None, 'SERVER_NAME': '192.168.0.92', 'SERVER_PORT': 8888, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>
self
[{'has_next': True, 'hits': 30, 'pages': 3, 'object_list': [<Address: limodou>, <Address: abc>, <Address: bcd>, <Address: ass>, <Address: dfsdf>, <Address: sfas>, <Address: sfsd>, <Address: sfasfsfsfas>, <Address: sfqwras>, <Address: wrr>], 'next': 2, 'results_per_page': 10, 'first_on_page': 1, 'has_previous': False, 'is_paginated': True, 'page': 1, 'last_on_page': 10, 'previous': 0}]
* c:\python25\Lib\site-packages\django\core\context_processors.py in auth
11.
12. def auth(request):
13. """
14. Returns context variables required by apps that use Django's authentication
15. system.
16. """
17. return {
18. 'user': request.user, ...
19. 'messages': request.user.get_and_delete_messages(),
20. 'perms': PermWrapper(request.user),
21. }
22.
23. def debug(request):
24. "Returns context variables helpful for debugging."
▶ Local vars
Variable Value
request
<ModPythonRequest path:/address/, GET:<MultiValueDict: {}>, POST:<MultiValueDict: {}>, COOKIES:{'sessionid': '14108ed5a09b3c3b6a1d210d6c86703e'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0L, 'CONTENT_TYPE': None, 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'HTTP_ACCEPT_CHARSET': 'gb2312,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'zh-cn,zh;q=0.5', 'HTTP_CACHE_CONTROL': 'max-age=0', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'sessionid=14108ed5a09b3c3b6a1d210d6c86703e', 'HTTP_HOST': 'wy:8888', 'HTTP_KEEP_ALIVE': '300', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7', 'PATH_INFO': '/', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '192.168.1.92', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': None, 'SERVER_NAME': '192.168.0.92', 'SERVER_PORT': 8888, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>
Traceback (most recent call last):
File "c:\python25\Lib\site-packages\django\core\handlers\base.py" in get_response
77. response = callback(request, *callback_args, **callback_kwargs)
File "c:\python25\Lib\site-packages\django\views\generic\list_detail.py" in object_list
70. }, context_processors)
File "c:\python25\Lib\site-packages\django\template\context.py" in __init__
100. self.update(processor(request))
File "c:\python25\Lib\site-packages\django\core\context_processors.py" in auth
18. 'user': request.user,
AttributeError at /address/
'ModPythonRequest' object has no attribute 'user'
Request information
GET
No GET data
POST
No POST data
COOKIES
Variable Value
sessionid
'14108ed5a09b3c3b6a1d210d6c86703e'
META
Variable Value
AUTH_TYPE
None
CONTENT_LENGTH
0L
CONTENT_TYPE
None
GATEWAY_INTERFACE
'CGI/1.1'
HTTP_ACCEPT
'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'
HTTP_ACCEPT_CHARSET
'gb2312,utf-8;q=0.7,*;q=0.7'
HTTP_ACCEPT_ENCODING
'gzip,deflate'
HTTP_ACCEPT_LANGUAGE
'zh-cn,zh;q=0.5'
HTTP_CACHE_CONTROL
'max-age=0'
HTTP_CONNECTION
'keep-alive'
HTTP_COOKIE
'sessionid=14108ed5a09b3c3b6a1d210d6c86703e'
HTTP_HOST
'wy:8888'
HTTP_KEEP_ALIVE
'300'
HTTP_USER_AGENT
'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7'
PATH_INFO
'/'
PATH_TRANSLATED
None
QUERY_STRING
None
REMOTE_ADDR
'192.168.1.92'
REMOTE_HOST
None
REMOTE_IDENT
None
REMOTE_USER
None
REQUEST_METHOD
'GET'
SCRIPT_NAME
None
SERVER_NAME
'192.168.0.92'
SERVER_PORT
8888
SERVER_PROTOCOL
'HTTP/1.1'
SERVER_SOFTWARE
'mod_python'
Settings
Using settings module newtest.settings_apache
Setting Value
ABSOLUTE_URL_OVERRIDES
{}
ADMINS
(('', ''),)
ADMIN_FOR
()
ADMIN_MEDIA_PREFIX
'/media/'
ALLOWED_INCLUDE_ROOTS
()
APPEND_SLASH
True
AUTHENTICATION_BACKENDS
('django.contrib.auth.backends.ModelBackend',)
BANNED_IPS
()
CACHE_BACKEND
'simple://'
CACHE_MIDDLEWARE_KEY_PREFIX
''
COMMENTS_ALLOW_PROFANITIES
False
COMMENTS_BANNED_USERS_GROUP
None
COMMENTS_FIRST_FEW
0
COMMENTS_MODERATORS_GROUP
None
COMMENTS_SKETCHY_USERS_GROUP
None
DATABASE_ENGINE
'sqlite3'
DATABASE_HOST
''
DATABASE_NAME
'D:/newtest/newtest/data.db'
DATABASE_OPTIONS
{}
DATABASE_PASSWORD
'********************'
DATABASE_PORT
''
DATABASE_USER
''
DATETIME_FORMAT
'N j, Y, P'
DATE_FORMAT
'N j, Y'
DEBUG
True
DEFAULT_CHARSET
'utf-8'
DEFAULT_CONTENT_TYPE
'text/html'
DEFAULT_FROM_EMAIL
'webmaster@localhost'
DISALLOWED_USER_AGENTS
()
EMAIL_HOST
'localhost'
EMAIL_HOST_PASSWORD
'********************'
EMAIL_HOST_USER
''
EMAIL_PORT
25
EMAIL_SUBJECT_PREFIX
'[Django] '
FIXTURE_DIRS
()
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
['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'newtest.wiki', 'newtest.address', 'django.contrib.admin']
INTERNAL_IPS
()
JING_PATH
'/usr/bin/jing'
LANGUAGES
(('ar', 'Arabic'), ('bn', 'Bengali'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('es_AR', 'Argentinean Spanish'), ('fi', 'Finnish'), ('fr', 'French'), ('gl', 'Galician'), ('hu', 'Hungarian'), ('he', 'Hebrew'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('kn', 'Kannada'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('pl', 'Polish'), ('pt', 'Portugese'), ('pt-br', 'Brazilian'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr', 'Serbian'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('te', 'Telugu'), ('tr', 'Turkish'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw', 'Traditional Chinese'))
LANGUAGES_BIDI
('he', 'ar')
LANGUAGE_CODE
'zh-cn'
MANAGERS
[]
MEDIA_ROOT
'D:/newtest/newtest/media'
MEDIA_URL
''
MIDDLEWARE_CLASSES
('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.doc.XViewMiddleware')
MONTH_DAY_FORMAT
'F j'
PREPEND_WWW
False
PROFANITIES_LIST
'********************'
ROOT_URLCONF
'newtest.urls'
SECRET_KEY
'********************'
SEND_BROKEN_LINK_EMAILS
False
SERVER_EMAIL
'root@localhost'
SESSION_COOKIE_AGE
1209600
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_NAME
'sessionid'
SESSION_COOKIE_SECURE
False
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
SESSION_SAVE_EVERY_REQUEST
False
SETTINGS_MODULE
'newtest.settings_apache'
SITE_ID
1
STATIC_PATH
'D:/newtest/newtest/media'
TEMPLATE_CONTEXT_PROCESSORS
('django.core.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n')
TEMPLATE_DEBUG
True
TEMPLATE_DIRS
('D:/newtest/newtest/templates',)
TEMPLATE_LOADERS
('django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source')
TEMPLATE_STRING_IF_INVALID
''
TEST_DATABASE_NAME
None
TEST_RUNNER
'django.test.simple.run_tests'
TIME_FORMAT
'P'
TIME_ZONE
'CCT'
TRANSACTIONS_MANAGED
False
UPLOAD_USER
'limodou'
URL_VALIDATOR_USER_AGENT
'Django/0.96pre (
http://www.djangoproject.com)'
USE_ETAGS
False
USE_I18N
True
YEAR_MONTH_FORMAT
'F Y'
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 500 page.