From a0509a23a4fb6fc0767119475b67eb91a625de68 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Mon, 27 Dec 2021 09:15:06 +0100 Subject: [PATCH] Create user login view --- .../ereuse_devicehub/user_login.html | 77 +++++++++++++++++++ ereuse_devicehub/views.py | 8 ++ 2 files changed, 85 insertions(+) create mode 100644 ereuse_devicehub/templates/ereuse_devicehub/user_login.html diff --git a/ereuse_devicehub/templates/ereuse_devicehub/user_login.html b/ereuse_devicehub/templates/ereuse_devicehub/user_login.html new file mode 100644 index 00000000..5d86efed --- /dev/null +++ b/ereuse_devicehub/templates/ereuse_devicehub/user_login.html @@ -0,0 +1,77 @@ +{% extends "ereuse_devicehub/base.html" %} +{% block body %} +
+
+ +
+
+
+
+ + + +
+ +
+ +
+
Login to Your Account
+

Enter your username & password to login

+
+ +
+ +
+ +
+ @ + +
Please enter your username.
+
+
+ +
+ + +
Please enter your password!
+
+ +
+
+ + +
+
+
+ +
+
+

Don't have account? Create an account

+
+
+ +
+
+ +
+ + + + + Designed by BootstrapMade +
+ +
+
+
+ +
+ +
+
+{% endblock body %} diff --git a/ereuse_devicehub/views.py b/ereuse_devicehub/views.py index 7cd92609..9e9f795d 100644 --- a/ereuse_devicehub/views.py +++ b/ereuse_devicehub/views.py @@ -5,6 +5,13 @@ from flask.views import View core = Blueprint('core', __name__) +class LoginView(View): + template_name = 'ereuse_devicehub/user_login.html' + + def dispatch_request(self): + return render_template(self.template_name) + + class UserProfileView(View): template_name = 'ereuse_devicehub/user_profile.html' @@ -12,4 +19,5 @@ class UserProfileView(View): return render_template(self.template_name) +core.add_url_rule('/login/', view_func=LoginView.as_view('login')) core.add_url_rule('/profile/', view_func=UserProfileView.as_view('user-profile'))