ajax (javascirpt)
var SendInfo= [];
var data = {
date:$("#datetimepicker").val(),
time:$("#time").val(),
people:$("#people").val()
}
SendInfo.push(data);
$.ajax({
url: YOUR_URL,
dataType: "json",
data: JSON.stringify(SendInfo),
type: 'POST',
success: function(data){
console.log(data.data)
}
});
view.py
data = json.loads(request.body)
print data[0]["date"]
print data[0]["time"]
print data[0]["people"]
'web > Django' 카테고리의 다른 글
get 방식의 글자 256자 제한은 잘못된 상식 (3) | 2016.05.24 |
---|---|
Django South migration error (0) | 2015.09.30 |
uwsgi logger disable option (0) | 2014.10.24 |
django.db.utils.IntegrityError: Can't DROP 'XXXX'; check that column/key exists (0) | 2014.10.21 |
django.db.utils.IntegrityError: Unknown table (0) | 2014.10.21 |