Django form request is always response with "GET" instead of "POST" even when I use <form action="" method="post">

Please help me m looking since hours for the solution but i didnt find something.

Here is my HTML:

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">

    <link rel="stylesheet" href="" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

        input {
            width: 10%;
            margin: 0 auto;
            display: block;
            margin-left: auto;
            margin-right: auto;



    {% load crispy_forms_tags %}

    <div class="container">
        <form action="" method="post">

        {% csrf_token %}
            {% crispy form %}
        <input type="submit" class="btn btn-primary mx-auto d-block">


and here is my

from django.shortcuts import render
from .forms import UserInformationForm
# Create your views here.

def register(request):
    form = UserInformationForm()
    context = {"form": form}


    if request.method == "POST":
        form = UserInformationForm(request.POST)
        if form.is_valid():

    return render(request, 'index.html', context)

The only response i get is: "GET /register/ HTTP/1.1" 200 3542

I already tried things like if request.method == "GET": But then I had on every field in my form a mark with "This fiel is required"

hello please check django documentation enter link description here

    form = UserInformationForm()
    context = {"form": form}

you dont have to add these codes.if this is a POST request we need to process the form data

Back to Top