Всем привет.Недавно начал изучать Джангу, делаю в ознакомительных целях проект, не получается с помощью Аякса создать объект.Запарился гуглить и переопределять post, form_valid, form_invalid. При отправке формы alert('nettt!') и редирект на созданный обьект!!! в консоль выводит :

`[16/Sep/2016 17:01:18] "POST /goods/add/ HTTP/1.1" 400 118
 [16/Sep/2016 17:01:18] "POST /goods/add/ HTTP/1.1" 302 0
 [16/Sep/2016 17:01:18] "GET /goods/70/ HTTP/1.1" 200 6238`

Знающие люди подскажите, в чем может быть проблема?

JS:

<script type="text/javascript">
$('#add').click(function add_item() {
    $('#add').hide();
    $('#add_item').show();
    var frm = $('#create');
    frm.submit(function(){
        $.ajax({
            type: frm.attr('method'),
            url: frm.attr('action'),
            data: frm.serialize(),
            success: function () {
                alert("da");
            },
            error: function() {
                alert('nettt!');
            }
        });
    });
    return false
});
</script>

VIews:

class AjaxableResponseMixin(object):

"""
Mixin to add AJAX support to a form.
Must be used with an object-based FormView (e.g. CreateView)
"""

def form_invalid(self, form):
    response = super(AjaxableResponseMixin, self).form_invalid(form)
    if self.request.is_ajax():
        return JsonResponse(form.errors, status=400)
    else:
        return response

def form_valid(self, form):
    response = super(AjaxableResponseMixin, self).form_valid(form)
    if self.request.is_ajax() and self.request.method == "POST":
        if form.is_valid():
            form.save()
            return JsonResponse(form)
    else:
        return response


class ItemNew(AjaxableResponseMixin, CreateView):

model = Item
form_class = NewItem

@method_decorator(login_required())
def dispatch(self, request, *args, **kwargs):
    return super(ItemNew, self).dispatch(request, *args, **kwargs)

def post(self, request, *args, **kwargs):
    self.object = None
    form_class = self.get_form_class()
    form = self.get_form(form_class)
    if form.is_valid():
        return self.form_valid(form)
    else:
        return self.form_invalid(form)

html:

<div id="add_item" class="col-md-4">
                <form action="{% url 'shop:add_item' %}" method="post" enctype="multipart/form-data" id="create">
                    {% csrf_token %}
                    {{ form.as_p }}
                    <input type="submit" value="отправить" />
                </form>
            </div>
            {% if user.is_authenticated %}
                <div class="col-md-4">
                    <a href="" class="btn btn-secondary" id="add">
                        <span class="glyphicon glyphicon-plus" about="" >Добавить</span>
                    </a>
                </div>
            {% endif %}

forms:

class NewItem(forms.ModelForm):
class Meta():
    model = Item
    exclude = ('created_date', 'image_item_small',)

urls:

app_name = 'shop'
urlpatterns = [
url(r'goods/add/$', ItemNew.as_view(), name='add_item'),
url(r'^$', TemplateView.as_view(template_name="shop/index.html")),
url(r'^goods/(?P<pk>[0-9]+)/$', ItemDetailView.as_view(), name='item_detail'),
url(r'^goods/(?P<pk>\d+)/edit/$', ItemUpdate.as_view(), name='edit_item'),
url(r'^goods/$', ItemListView.as_view(), name='goods'),

 ]