Is this login fail? or?

when click login the page no blank to home page just stay in login page
the terminal show me "GET /login/?csrfmiddlewaretoken=LK82SQKdzu802NaUuXom8CWRn3S86WWK0XrzEqFCCrUmGGCe06MXoMgFtt0JLDRN&username=tim&password=tim123 HTTP/1.1" 200 3148 and the browser link this


{% extends "main/base.html" %}

{% block title %}
  Login Here
{% endblock title %}

{% load crispy_forms_tags %}

{% block content %}
  <form class="from-group" method="get">
    {% csrf_token %}
    {{form | crispy}}
    <button type="submit" class="btn btn-success">Login</button>
    <p>Don't have an account? Create one <a href="/register">Here</a></p>
{% endblock content %} (i just skip to STARIC it so long

STATIC_URL = 'static/'

CRISPY_TEMPLATE_PACK = "bootstrap4" (add) 


from django.contrib import admin
from django.urls import path, include
from register import views as v

urlpatterns = [
    path('register/', v.register, name='register'),
    path('', include('main.urls')),
    path('', include('django.contrib.auth.urls')),

>Solution :

I think you got this message in terminal because of form method get. For login form, it must be POST not GET.

instead of this:

<form class="from-group" method="get">

Try this:

<form class="from-group" method="post">

Leave a Reply