以10为底的int()的无效文字:' [英] invalid literal for int() with base 10: '

查看:232
本文介绍了以10为底的int()的无效文字:'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在我的项目中添加了哨兵以进行错误跟踪,并根据文档这里,但出现下面显示的错误.

I recently added sentry for error tracking in my project and configure raven according to documentation here but getting the error shown below.

import raven


INSTALLED_APPS = [    
    # 3rd party app
    'raven.contrib.django.raven_compat',
]    

RAVEN_CONFIG = {
    'dsn': 'https://*****@sentry.io/224093',
    'release': raven.fetch_git_sha(os.path.dirname(os.pardir)),
}

错误日志

System check identified no issues (0 silenced).
October 02, 2017 - 11:31:58
Django version 1.10, using settings 'FoodCham.settings.development'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Sending message of length 2240 to https://sentry.io/api/224093/store/
Internal Server Error: /
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 244, in _legacy_get_response
    response = middleware_method(request)
  File "/usr/local/lib/python2.7/dist-packages/raven/contrib/django/middleware/__init__.py", line 135, in process_request
    request.body  # forces stream to be read into memory
  File "/usr/local/lib/python2.7/dist-packages/django/http/request.py", line 267, in body
    int(self.META.get('CONTENT_LENGTH', 0)) > settings.DATA_UPLOAD_MAX_MEMORY_SIZE):
ValueError: invalid literal for int() with base 10: ''
Internal Server Error: /
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)

  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 244, in _legacy_get_response
    response = middleware_method(request)
  File "/usr/local/lib/python2.7/dist-packages/raven/contrib/django/middleware/__init__.py", line 135, in process_request
    request.body  # forces stream to be read into memory
  File "/usr/local/lib/python2.7/dist-packages/django/http/request.py", line 267, in body
    int(self.META.get('CONTENT_LENGTH', 0)) > settings.DATA_UPLOAD_MAX_MEMORY_SIZE):
ValueError: invalid literal for int() with base 10: ''
[02/Oct/2017 11:32:04] "GET / HTTP/1.1" 500 69274

任何有帮助的答案将不胜感激!

Any helpful answer will be appreciated!

推荐答案

这是Django中的一个错误,不在raven中,已在 Django 1.10.8 ,只需将django-1.10升级到django-1.10.8,就可以正常工作.

It's a bug in Django not in raven which is solved in Django 1.10.8, by just upgrading django-1.10 to django-1.10.8 it works fine.

这篇关于以10为底的int()的无效文字:'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆