Django에서 Heroku의 도구 및 가이드를 사용하여 응용 프로그램을 개발 중이며 문제가 발생했습니다. 내 로컬 dev에 환경에서 나는 post 메서드를 사용하는 경우 내 의견에서 응답을 얻을 수 없습니다. 현재 간단한 폼을 사용하여 ID 컬렉션을보기에 게시하고 있습니다.Django 개발 서버, 비어있는 HttpResponse on Post 메서드
콘솔에는 200 응답 OK가 표시됩니다. 그러나 브라우저는 빈 html 페이지 (빈 body 태그)를 표시합니다.
생산/heroku 서버에서 응답이 반환되므로 코드 자체에 문제가있는 것이 아니라 설정 파일에 문제가 있다고 생각합니다. 나는 heroku django 설치 가이드를 통해 돌아가서 로컬 컴퓨터에 환경 변수를 사용하여 로컬 dev에있는 경우 해당 설정을 해제했지만 여전히이 문제가 있습니다.
수정 프로그램을 어디에서 찾을 수 있습니까? Windows 7 virtualenv 래퍼, 파이썬 2.7.5 및 장고 1.5 실행 중입니다.
고마워. 코멘트에서 요구 사항에 따라
는 WebinarToHS 템플릿 파일은 다음과 같습니다 :
<html>
<head>
<title>Add Webinars to Hubspot</title>
<style>
html, body {background-color: #eee;}
#wrapper {background-color: #fefefe; width:60%; margin:0 auto; position:relative; margin-top:50px; padding:25px;}
form {text-align:center;}
label {font-weight:bold;}
.submit {float:right;}
.check {float:left; text-align:left; max-width:48%; margin-right:2%;}
</style>
</head>
<body>
<div id="wrapper">
<form name="form" action="{%url 'G2WApi.views.webinarToHS' %}" method="post">
{% csrf_token %}
<label for="webinarKey">Choose the Webinar(s) you would like to add to hubspot:</label><br/><br/>
<div class="check">
{% for webinar in webinars %}
<input type="checkbox" name="webinars[]" value="{{ webinar.webinarKey }}" />{{ webinar.subject }}<br/>
{% if forloop.counter|divisibleby:length %}
</div><div class="check">
{% endif %}
{% endfor %}
</div>
<div style="clear:both; height:10px;"></div>
<input class="submit" type="submit" value="Add to Hubspot" />
</form>
</div>
</body>
</html>
은 'webinarToHS.html' 템플릿 파일을 공유합니다. –