base.html код javascript<script>
$(document).ready(function(){
$(".fantom").click(function(){
$('.fantom').hide();
$.post("/control",function(data){alert(data);});
});
});
</script>
template.html<a class="fantom" href="javascript:">Запуск javascript</a>
views.pydef control(request):
data=0
if request.is_ajax():
data=1
return HttpResponse(data)
urls.pyurl(r'^control/$','hello.views.control',name='control'),
Проблема в том что не работает post запрос. Ошибка в консоли:
POST http://gae/control 500 (Internal Server Error) jquery.js:7845x.support.cors.e.crossDomain.send jquery.js:7845x.extend.ajax jquery.js:7301x.(anonymous function) jquery.js:7447(anonymous function) (index):16x.event.dispatch jquery.js:4676y.handle
С GET все отлично работает. В чем может быть ошибка? ($.ajax также с GET работает, с POST нет)