1
Django 1.7이 있고 장고에 POST 요청을 제출할 때이 오류가 계속 발생합니다.Django에서 Django 오류가 발생했습니다. django 1.7에서 거짓입니다.
디버그가 true이면 오류가 발생하지 않습니다.
나는 이미 내가 ALLOWED_HOST
의 모든 주소를 추가 한이
Setting DEBUG = False causes 500 Error
살펴 보았다하지만 난 오류
[Django] ERROR (EXTERNAL IP): Internal Server Error:
Internal Server Error: /api/user/edit
Traceback (most recent call last):
File "/srv/vhosts/site1/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 204, in get_response
response = middleware_method(request, response)
File "/srv/vhosts/site1/env/local/lib/python2.7/site-packages/htmlmin/middleware.py", line 41, in process_response
if minify and self.can_minify_response(request, response):
File "/srv/vhosts/site1/env/local/lib/python2.7/site-packages/htmlmin/middleware.py", line 32, in can_minify_response
resp_ok = resp_ok and 'text/html' in response['Content-Type']
File "/srv/vhosts/site1/env/local/lib/python2.7/site-packages/django/http/response.py", line 187, in __getitem__
return self._headers[header.lower()][1]
KeyError: 'content-type'
Request repr():
<WSGIRequest
path://api/user/edit,
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{'csrftoken': 'HN2zP9edr2ItI5uW6tMocemUBczPiN4C',
'sessionid': 'y10w8jqqertztttrol63bqtjfj8qa4c6'},
META:{'CONTENT_LENGTH': '37',
'CONTENT_TYPE': 'application/json;charset=UTF-8',
u'CSRF_COOKIE': u'HN2zP9edr2ItI5uW6tMocemUBczPiN4C',
'HTTP_ACCEPT': 'application/json, text/plain, */*',
'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
'HTTP_ACCEPT_LANGUAGE': 'en-GB,en-US;q=0.8,en;q=0.6',
'HTTP_CONNECTION': 'close',
'HTTP_COOKIE': 'sessionid=y10w8jqqertztttrol63bqtjfj8qa4c6; csrftoken=HN2zP9edr2ItI5uW6tMocemUBczPiN4C',
'HTTP_HOST': '104.60.4.102',
'HTTP_ORIGIN': 'https://104.60.4.102,
'HTTP_REFERER': 'https://104.60.4.102/users/',
'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36',
'HTTP_X_CSRFTOKEN': 'HN2zP9edr2ItI5uW6tMocemUBczPiN4C',
'HTTP_X_FORWARDED_FOR': '104.60.4.160',
'PATH_INFO': u'//api/user/edit',
'QUERY_STRING': '',
'RAW_URI': '/api/user/edit',
'REMOTE_ADDR': '',
'REQUEST_METHOD': 'POST',
'SCRIPT_NAME': u'',
'SERVER_NAME': '104.60.4.102',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.0',
'SERVER_SOFTWARE': 'gunicorn/19.0.0',
'gunicorn.socket': <socket._socketobject object at 0x5daa910>,
'wsgi.errors': <gunicorn.http.wsgi.WSGIErrorsWraper object at 0x5dbae10>,
'wsgi.file_wrapper': <class 'gunicorn.http.wsgi.FileWrapper'>,
'wsgi.input': <gunicorn.http.body.Body object at 0x5dbaf10>,
'wsgi.multiprocess': True,
'wsgi.multithread': False,
'wsgi.run_once': False,
'wsgi.url_scheme': 'http',
'wsgi.version': (1, 0)}>
그 문제
될 수있는 경우 REMOTE_ADDR은''
으로 오는에게 점점 계속
데이터가 데이터베이스에 잘 게시되지만 방화 광에서 오류가 발생합니다.
감사했다. 콘텐츠 유형을 설정하지 않습니다. 난 장고 휴식 프레임 워크를 사용하고 있습니다. 확실하지 그것의 설정 점점 – user3214546