From 62efec13981910db9e6b9e919ba096f2960d2e47 Mon Sep 17 00:00:00 2001 From: sosokker Date: Sat, 18 Nov 2023 23:16:13 +0700 Subject: [PATCH] Add login page --- core/settings.py | 3 +- core/urls.py | 2 +- templates/base.html | 24 +++++++++++++ templates/inventory/index.html | 45 ++++++++---------------- templates/registration/login.html | 57 +++++++++++++++++++++++++++++++ 5 files changed, 99 insertions(+), 32 deletions(-) create mode 100644 templates/base.html create mode 100644 templates/registration/login.html diff --git a/core/settings.py b/core/settings.py index 73bbdad..019a7da 100644 --- a/core/settings.py +++ b/core/settings.py @@ -133,4 +133,5 @@ STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'staticfiles'), ] -LOGIN_REDIRECT_URL = "/" \ No newline at end of file +LOGIN_REDIRECT_URL = "/" +LOGOUT_REDIRECT_URL = "/accounts/login/" \ No newline at end of file diff --git a/core/urls.py b/core/urls.py index 92808d6..eb1afd7 100644 --- a/core/urls.py +++ b/core/urls.py @@ -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/')), ] diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..687b1f3 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,24 @@ +{% load static %} + + + + + + + + + + + SB Admin 2 - Login + + + + + + + + + {% block content %}{% endblock %} + diff --git a/templates/inventory/index.html b/templates/inventory/index.html index e2c6475..f855ec9 100644 --- a/templates/inventory/index.html +++ b/templates/inventory/index.html @@ -1,30 +1,6 @@ - - - -{% load static %} - - - - - - - - - Inventory Management System - - - - - - - - - - - +{% extends "base.html" %} +{% block content %} @@ -210,11 +186,21 @@ + + + +
+ @@ -417,5 +403,4 @@ - - \ No newline at end of file +{% endblock content %} \ No newline at end of file diff --git a/templates/registration/login.html b/templates/registration/login.html new file mode 100644 index 0000000..1eee3f8 --- /dev/null +++ b/templates/registration/login.html @@ -0,0 +1,57 @@ +{% extends "base.html" %} + +{% block content %} + + +
+ + +
+ +
+ +
+
+ +
+ +
+
+
+

Welcome Back!

+
+
+ {% csrf_token %} + {{ form.as_p }} + +
+
+ +
+
+
+
+
+ +
+ +
+ +
+ +{% endblock content %} + + +{% comment %}
+ +
+
+ +
{% endcomment %} \ No newline at end of file