# My django request.POST can't work.

**URL:** <https://forum.djangoproject.com/t/my-django-request-post-cant-work/13901>\
**Category:** Mystery Errors\
**Created:** [May 24, 2022, 1:55pm UTC](https://forum.djangoproject.com/t/my-django-request-post-cant-work/13901 "2022-05-24T13:55:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Feelixxxx](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/feelixxxx/32/8641_2.png) [@Feelixxxx](https://forum.djangoproject.com/u/Feelixxxx)\
**Post date:** [May 24, 2022, 1:56pm UTC](https://forum.djangoproject.com/t/my-django-request-post-cant-work/13901/1 "2022-05-24T13:56:00Z")

</div>

```
def product_create_view(request, *args, **kwargs):

    form = ProductForm(request.POST or None)

    if form.is_valid() :      
        print(request.POST)
        print(form.cleaned_data)

  
    return render(request, 'forms.html', {'form':form})

```

My forms.html:

```
{% extends 'base.html' %}

{% block content %}

<form mathod="POST" action='.'>{% csrf_token %}

    {{ form.as_p }}

    <button type="submit"> Send data</button>

</form>

{% endblock %}

```

When I in my web enter something in textbox and send data.  
My views.py  
print(request.POST) show nothing and it can’t save to my admin product.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [May 24, 2022, 2:04pm UTC](https://forum.djangoproject.com/t/my-django-request-post-cant-work/13901/2 "2022-05-24T14:04:08Z")

</div>

Please do not post screenshots of code here.

Copy/paste the code into the body of your message, between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```.

---

<div class="post-metadata">

**Author:** ![Feelixxxx](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/feelixxxx/32/8641_2.png) [@Feelixxxx](https://forum.djangoproject.com/u/Feelixxxx)\
**Post date:** [May 24, 2022, 2:12pm UTC](https://forum.djangoproject.com/t/my-django-request-post-cant-work/13901/3 "2022-05-24T14:12:28Z")

</div>

Sorry~  
I will try again.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [May 24, 2022, 2:35pm UTC](https://forum.djangoproject.com/t/my-django-request-post-cant-work/13901/4 "2022-05-24T14:35:26Z")

</div>

You’re close - it looks like you’re using apostrophe - ’ instead of the backtick - `

Anyway, from what I can see, the most likely case is that your form isn’t passing the `is_valid` test.

You can print your `request.POST` before the `if` to see what has been submitted.

It may also help to see your forms.html template. (Also posted as text here between lines of three backtick - ` characters.)

---

<div class="post-metadata">

**Author:** ![Feelixxxx](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/feelixxxx/32/8641_2.png) [@Feelixxxx](https://forum.djangoproject.com/u/Feelixxxx)\
**Post date:** [May 24, 2022, 3:18pm UTC](https://forum.djangoproject.com/t/my-django-request-post-cant-work/13901/5 "2022-05-24T15:18:19Z")

</div>

My forms.html:

```auto

{% block content %}

<form mathod="POST" action='.'>{% csrf_token %}

    {{ form.as_p }}

    <button type="submit"> Send data</button>

</form>

{% endblock %}

```

I know the method can change GET and POST ,  
When I use ( mathod = ‘POST’ )  
request.GET can get the data,  
but request.Post can’t.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [May 24, 2022, 4:25pm UTC](https://forum.djangoproject.com/t/my-django-request-post-cant-work/13901/6 "2022-05-24T16:25:16Z")

</div>

I see one issue - in your `form` tag in your template, the attribute should be **method** , not “mathod”.

---

<div class="post-metadata">

**Author:** ![Feelixxxx](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/feelixxxx/32/8641_2.png) [@Feelixxxx](https://forum.djangoproject.com/u/Feelixxxx)\
**Post date:** [May 25, 2022, 7:45am UTC](https://forum.djangoproject.com/t/my-django-request-post-cant-work/13901/7 "2022-05-25T07:45:00Z")

</div>

Oh… ,I found that mistake, thank for your helping~
