Solving the issues in the login and others

This commit is contained in:
Vivek P Prakash
2025-11-28 16:03:23 +05:30
parent fabd36cf3f
commit c4d7d4f6bf
7 changed files with 461 additions and 211 deletions

View File

@@ -1,54 +1,54 @@
{% extends 'base.html' %}
{% block content %}
{% load static %}
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
rel="stylesheet">
</head>
<div class="row justify-content-center mt-5">
<div class="col-md-4">
<body class="bg-light">
<div class="card shadow-sm border-0 rounded-3">
<div class="card-body p-4">
<div class="container d-flex justify-content-center mt-5">
<div class="col-md-4">
<h3 class="text-center mb-4">Login</h3>
<div class="card shadow-sm p-4">
<form method="post" novalidate>
{% csrf_token %}
{{ form.non_field_errors }}
<h4 class="text-center mb-3">Login</h4>
<!-- Username field -->
<div class="mb-3">
<label class="form-label">{{ form.username.label }}</label>
<input
type="text"
name="{{ form.username.name }}"
value="{{ form.username.value|default:'' }}"
class="form-control"
placeholder="Enter username"
required
>
{{ form.username.errors }}
</div>
{% if messages %}
{% for message in messages %}
<div class="alert alert-danger py-2">{{ message }}</div>
{% endfor %}
{% endif %}
<!-- Password field -->
<div class="mb-3">
<label class="form-label">{{ form.password.label }}</label>
<input
type="password"
name="{{ form.password.name }}"
class="form-control"
placeholder="Enter password"
required
>
{{ form.password.errors }}
</div>
<form method="post" novalidate>
{% csrf_token %}
<button type="submit" class="btn btn-primary w-100">
Login
</button>
</form>
<div class="mb-3">
{{ form.username.label_tag }}
{{ form.username }}
{% for error in form.username.errors %}
<small class="text-danger">{{ error }}</small>
{% endfor %}
</div>
<div class="mb-3">
{{ form.password.label_tag }}
{{ form.password }}
{% for error in form.password.errors %}
<small class="text-danger">{{ error }}</small>
{% endfor %}
</div>
<button class="btn btn-primary w-100">Login</button>
</form>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
</body>
</html>