bot
- класс из пакета, или сами что-то писали? class AJAXPost(views.View):
def dispatch(self, request, *args, **kwargs):
if not request.is_ajax():
return http.HttpResponseBadRequest(
_('Direct HTTP request is not allowed'))
if not request.method == 'POST':
return http.HttpResponseBadRequest(
_('GET requests are not allowed'))
return super(AJAXPost, self).dispatch(request, *args, **kwargs)
def post(self, request, *args, **kwargs):
data = { 'images': 'images', 'description': 'description' }
return http.JsonResponse(data)
post
метод:def post(self, request, *args, **kwargs):
response = super(
ProductAlertCreateView, self).post(request, *args, **kwargs)
if request.is_ajax():
return http.JsonResponse({
'status': "success",
})
return response
/kick @id123
, а что-то другое