mirror of
https://github.com/Sosokker/Inventory-Management-System.git
synced 2025-12-18 15:14:05 +01:00
Add login page
This commit is contained in:
parent
7280cb0e80
commit
62efec1398
@ -133,4 +133,5 @@ STATICFILES_DIRS = [
|
||||
os.path.join(BASE_DIR, 'staticfiles'),
|
||||
]
|
||||
|
||||
LOGIN_REDIRECT_URL = "/"
|
||||
LOGIN_REDIRECT_URL = "/"
|
||||
LOGOUT_REDIRECT_URL = "/accounts/login/"
|
||||
@ -6,5 +6,5 @@ urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path("accounts/", include("django.contrib.auth.urls")), # new
|
||||
path('dashboard/', include('inventory.urls'), name='dashboard'),
|
||||
path('', RedirectView.as_view(url='/dashboard/')),
|
||||
path('', RedirectView.as_view(url='/dashboard/overview/')),
|
||||
]
|
||||
|
||||
24
templates/base.html
Normal file
24
templates/base.html
Normal file
@ -0,0 +1,24 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>SB Admin 2 - Login</title>
|
||||
|
||||
<!-- Custom fonts for this template-->
|
||||
<link href={% static "vendor/fontawesome-free/css/all.min.css" %} rel="stylesheet" type="text/css">
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
|
||||
rel="stylesheet">
|
||||
|
||||
<!-- Custom styles for this template-->
|
||||
<link href={% static 'css/sb-admin-2.min.css' %} rel="stylesheet">
|
||||
</head>
|
||||
{% block content %}{% endblock %}
|
||||
</html>
|
||||
@ -1,30 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
{% load static %}
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>Inventory Management System</title>
|
||||
|
||||
<!-- Custom fonts for this template-->
|
||||
<link href={% static 'vendor/fontawesome-free/css/all.min.css' %} rel="stylesheet" type="text/css">
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
|
||||
rel="stylesheet">
|
||||
|
||||
<!-- Custom styles for this template-->
|
||||
<link href={% static 'css/sb-admin-2.css' %} rel="stylesheet">
|
||||
<link href={% static 'css/sb-admin-2.min.css' %} rel="stylesheet">
|
||||
<script href={% static "js/sb-admin-2.js" %}></script>
|
||||
|
||||
</head>
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<body id="page-top">
|
||||
|
||||
<!-- Page Wrapper -->
|
||||
@ -210,11 +186,21 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<!-- Logout -->
|
||||
<li class="nav-item dropdown no-arrow">
|
||||
<a class="nav-link dropdown-toggle" id="userDropdown" role="button" href={% url "logout" %}
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="mr-2 d-none d-lg-inline font-weight-bold text-gray-800">Logout</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<div class="topbar-divider d-none d-sm-block"></div>
|
||||
|
||||
<!-- Nav Item - User Information -->
|
||||
<li class="nav-item dropdown no-arrow">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button"
|
||||
<a class="nav-link dropdown-toggle" id="userDropdown" role="button"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="mr-2 d-none d-lg-inline text-gray-600 small">Douglas McGee</span>
|
||||
<span class="mr-2 d-none d-lg-inline font-weight-bold text-gray-800">Hi {{ user.username }}!</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@ -417,5 +403,4 @@
|
||||
<script src="js/demo/chart-pie-demo.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
{% endblock content %}
|
||||
57
templates/registration/login.html
Normal file
57
templates/registration/login.html
Normal file
@ -0,0 +1,57 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<body class="bg-gradient-primary">
|
||||
|
||||
<div class="container">
|
||||
|
||||
<!-- Outer Row -->
|
||||
<div class="row justify-content-center">
|
||||
|
||||
<div class="col-xl-10 col-lg-12 col-md-9">
|
||||
|
||||
<div class="card o-hidden border-0 shadow-lg my-5">
|
||||
<div class="card-body p-0">
|
||||
<!-- Nested Row within Card Body -->
|
||||
<div class="row">
|
||||
<div class="col-lg-6 d-none d-lg-block bg-login-image"></div>
|
||||
<div class="col-lg-6">
|
||||
<div class="p-5">
|
||||
<div class="text-center">
|
||||
<h1 class="h4 text-gray-900 mb-4">Welcome Back!</h1>
|
||||
</div>
|
||||
<form class="user" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button href={% url "overview" %} class="btn btn-primary btn-user btn-block" type="submit">
|
||||
Login
|
||||
</button>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="text-center">
|
||||
<a class="small" href="register.html">Create an Account!</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
{% endblock content %}
|
||||
|
||||
|
||||
{% comment %} <div class="form-group">
|
||||
<input type="email" class="form-control form-control-user"
|
||||
id="exampleInputEmail" aria-describedby="emailHelp"
|
||||
placeholder="Enter Username...">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" class="form-control form-control-user"
|
||||
id="exampleInputPassword" placeholder="Password">
|
||||
</div> {% endcomment %}
|
||||
Loading…
Reference in New Issue
Block a user