django-grappelli 和罕见的大量错误
我在我的项目中使用 Django-grappelli,但是 Django 向我的电子邮件发送了很多关于 Django 未找到的文件的错误...但我不知道从哪里调用这些文件...有时文件 .aspx (??)
这是一个错误详细信息:
Traceback (most recent call last):
File "/home/*******/django/lib/python2.5/django/core/handlers/base.py", line 92, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/*******/django/lib/python2.5/django/contrib/admin/options.py", line 226, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/*******/django/lib/python2.5/django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/home/*******/django/lib/python2.5/django/contrib/admin/sites.py", line 186, in inner
return view(request, *args, **kwargs)
File "/home/*******/django/lib/python2.5/django/db/transaction.py", line 240, in _commit_on_success
res = func(*args, **kw)
File "/home/*******/django/lib/python2.5/django/contrib/admin/options.py", line 793, in change_view
obj = self.queryset(request).get(pk=unquote(object_id))
File "/home/*******/django/lib/python2.5/django/db/models/query.py", line 299, in get
clone = self.filter(*args, **kwargs)
File "/home/*******/django/lib/python2.5/django/db/models/query.py", line 498, in filter
return self._filter_or_exclude(False, *args, **kwargs)
File "/home/*******/django/lib/python2.5/django/db/models/query.py", line 516, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File "/home/*******/django/lib/python2.5/django/db/models/sql/query.py", line 1675, in add_q
can_reuse=used_aliases)
File "/home/*******/django/lib/python2.5/django/db/models/sql/query.py", line 1614, in add_filter
connector)
File "/home/*******/django/lib/python2.5/django/db/models/sql/where.py", line 56, in add
obj, params = obj.process(lookup_type, value)
File "/home/*******/django/lib/python2.5/django/db/models/sql/where.py", line 269, in process
params = self.field.get_db_prep_lookup(lookup_type, value)
File "/home/*******/django/lib/python2.5/django/db/models/fields/__init__.py", line 210, in get_db_prep_lookup
return [self.get_db_prep_value(value)]
File "/home/*******/django/lib/python2.5/django/db/models/fields/__init__.py", line 361, in get_db_prep_value
return int(value)
ValueError: invalid literal for int() with base 10: 'add/css/slimbox.css'
<WSGIRequest
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{'__utma': '9939636.788794993.1264095329.1264182265.1264185471.12',
'__utmb': '9939636.6.10.1264185471',
'__utmc': '9939636',
'__utmz': '9939636.1264095329.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)',
'sessionid': '7cbe112dbf1b85f902262a9757c8c6d4'},
META:{'DOCUMENT_ROOT': '/usr/local/apache2/htdocs',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTP_ACCEPT': '*/*',
'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
'HTTP_ACCEPT_LANGUAGE': 'es-ar',
'HTTP_CONNECTION': 'close',
'HTTP_COOKIE': '__utma=9939636.788794993.1264095329.1264182265.1264185471.12; __utmz=9939636.1264095329.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=9939636; __utmb=9939636.6.10.1264185471; sessionid=7cbe112dbf1b85f902262a9757c8c6d4',
'HTTP_HOST': 'www.*******',
'HTTP_REFERER': 'http://www.*******/admin/noticias/noticia/add/',
'HTTP_USER_AGENT': 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.3; .NET CLR 1.1.4322; .NET CLR 2.0.50727; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)',
'HTTP_X_FORWARDED_FOR': '201.229.208.152',
'PATH': '/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/*******/bin',
'PATH_INFO': u'/admin/noticias/noticia/add/css/slimbox.css/',
'PATH_TRANSLATED': '/home/*******/django/*******.wsgi/admin/noticias/noticia/add/css/slimbox.css/',
'QUERY_STRING': '',
'REMOTE_ADDR': '127.0.0.1',
'REMOTE_PORT': '34304',
'REQUEST_METHOD': 'GET',
'REQUEST_URI': '/admin/noticias/noticia/add/css/slimbox.css/',
'SCRIPT_FILENAME': '/*******/django/*******.wsgi',
'SCRIPT_NAME': u'',
'SERVER_ADDR': '127.0.0.1',
'SERVER_ADMIN': '[no address given]',
'SERVER_NAME': 'www.*******',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.0',
'SERVER_SIGNATURE': '',
'SERVER_SOFTWARE': 'Apache/2.2.12 (Unix) mod_wsgi/2.5 Python/2.5.4',
'mod_wsgi.application_group': '*******.com|',
'mod_wsgi.callable_object': 'application',
'mod_wsgi.listener_host': '',
'mod_wsgi.listener_port': '*******',
'mod_wsgi.process_group': '',
'mod_wsgi.reload_mechanism': '0',
'mod_wsgi.script_reloading': '1',
'mod_wsgi.version': (2, 5),
'wsgi.errors': <mod_wsgi.Log object at 0x9016d40>,
'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x91e97b8>,
'wsgi.input': <mod_wsgi.Input object at 0x901cca0>,
'wsgi.multiprocess': True,
'wsgi.multithread': False,
'wsgi.run_once': False,
'wsgi.url_scheme': 'http',
'wsgi.version': (1, 0)}>
该网站运行得非常好,但我的电子邮件充满了这些错误,最好的是我的项目中没有任何这些文件....
抱歉如果错误太长,请原谅我的英语。
谢谢大家
I'm using Django-grappelli in my project, but Django is send me a lot of errors to my email about some files that Django didn't found...but I don't know from where is calling this files...some time files .aspx (??)
Here is a image with the error list in my inbox
Here is a error detail:
Traceback (most recent call last):
File "/home/*******/django/lib/python2.5/django/core/handlers/base.py", line 92, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/*******/django/lib/python2.5/django/contrib/admin/options.py", line 226, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/*******/django/lib/python2.5/django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/home/*******/django/lib/python2.5/django/contrib/admin/sites.py", line 186, in inner
return view(request, *args, **kwargs)
File "/home/*******/django/lib/python2.5/django/db/transaction.py", line 240, in _commit_on_success
res = func(*args, **kw)
File "/home/*******/django/lib/python2.5/django/contrib/admin/options.py", line 793, in change_view
obj = self.queryset(request).get(pk=unquote(object_id))
File "/home/*******/django/lib/python2.5/django/db/models/query.py", line 299, in get
clone = self.filter(*args, **kwargs)
File "/home/*******/django/lib/python2.5/django/db/models/query.py", line 498, in filter
return self._filter_or_exclude(False, *args, **kwargs)
File "/home/*******/django/lib/python2.5/django/db/models/query.py", line 516, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File "/home/*******/django/lib/python2.5/django/db/models/sql/query.py", line 1675, in add_q
can_reuse=used_aliases)
File "/home/*******/django/lib/python2.5/django/db/models/sql/query.py", line 1614, in add_filter
connector)
File "/home/*******/django/lib/python2.5/django/db/models/sql/where.py", line 56, in add
obj, params = obj.process(lookup_type, value)
File "/home/*******/django/lib/python2.5/django/db/models/sql/where.py", line 269, in process
params = self.field.get_db_prep_lookup(lookup_type, value)
File "/home/*******/django/lib/python2.5/django/db/models/fields/__init__.py", line 210, in get_db_prep_lookup
return [self.get_db_prep_value(value)]
File "/home/*******/django/lib/python2.5/django/db/models/fields/__init__.py", line 361, in get_db_prep_value
return int(value)
ValueError: invalid literal for int() with base 10: 'add/css/slimbox.css'
<WSGIRequest
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{'__utma': '9939636.788794993.1264095329.1264182265.1264185471.12',
'__utmb': '9939636.6.10.1264185471',
'__utmc': '9939636',
'__utmz': '9939636.1264095329.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)',
'sessionid': '7cbe112dbf1b85f902262a9757c8c6d4'},
META:{'DOCUMENT_ROOT': '/usr/local/apache2/htdocs',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTP_ACCEPT': '*/*',
'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
'HTTP_ACCEPT_LANGUAGE': 'es-ar',
'HTTP_CONNECTION': 'close',
'HTTP_COOKIE': '__utma=9939636.788794993.1264095329.1264182265.1264185471.12; __utmz=9939636.1264095329.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=9939636; __utmb=9939636.6.10.1264185471; sessionid=7cbe112dbf1b85f902262a9757c8c6d4',
'HTTP_HOST': 'www.*******',
'HTTP_REFERER': 'http://www.*******/admin/noticias/noticia/add/',
'HTTP_USER_AGENT': 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.3; .NET CLR 1.1.4322; .NET CLR 2.0.50727; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)',
'HTTP_X_FORWARDED_FOR': '201.229.208.152',
'PATH': '/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/*******/bin',
'PATH_INFO': u'/admin/noticias/noticia/add/css/slimbox.css/',
'PATH_TRANSLATED': '/home/*******/django/*******.wsgi/admin/noticias/noticia/add/css/slimbox.css/',
'QUERY_STRING': '',
'REMOTE_ADDR': '127.0.0.1',
'REMOTE_PORT': '34304',
'REQUEST_METHOD': 'GET',
'REQUEST_URI': '/admin/noticias/noticia/add/css/slimbox.css/',
'SCRIPT_FILENAME': '/*******/django/*******.wsgi',
'SCRIPT_NAME': u'',
'SERVER_ADDR': '127.0.0.1',
'SERVER_ADMIN': '[no address given]',
'SERVER_NAME': 'www.*******',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.0',
'SERVER_SIGNATURE': '',
'SERVER_SOFTWARE': 'Apache/2.2.12 (Unix) mod_wsgi/2.5 Python/2.5.4',
'mod_wsgi.application_group': '*******.com|',
'mod_wsgi.callable_object': 'application',
'mod_wsgi.listener_host': '',
'mod_wsgi.listener_port': '*******',
'mod_wsgi.process_group': '',
'mod_wsgi.reload_mechanism': '0',
'mod_wsgi.script_reloading': '1',
'mod_wsgi.version': (2, 5),
'wsgi.errors': <mod_wsgi.Log object at 0x9016d40>,
'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x91e97b8>,
'wsgi.input': <mod_wsgi.Input object at 0x901cca0>,
'wsgi.multiprocess': True,
'wsgi.multithread': False,
'wsgi.run_once': False,
'wsgi.url_scheme': 'http',
'wsgi.version': (1, 0)}>
The website is running very nice, but my email is full of this errors, and the best thing is that i dont have any of these files in my project....
Sorry if the error is too long and sorry with my English.
Thanks guys
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ValueError: invalid Literal for int() with base 10: 'add/css/slimbox.css'
显然有一个视图函数期望一个仅包含数字的字符串,但由于某种原因该字符串包含文字字符,并使其变为 int () 构造函数。
这可能是由于 URLconf 中的正则表达式错误造成的,和,可能您忘记用正确的 try..except 包围代码块。
从 django 接收大量电子邮件的其他常见原因是
SEND_BROKEN_LINK_EMAILS = True
settings.py 中的
ValueError: invalid literal for int() with base 10: 'add/css/slimbox.css'
Apparently there's a view function expecting a string containing only digits, but for some reason that string contains literal characters, and made his way to a int() constructor.
This could be due to a wrong regex in your URLconf, and, probably you forgot to surround a code block with the proper try..except.
Other common reason for receiving tons of emails from django is
SEND_BROKEN_LINK_EMAILS = True
in settings.py