The Login Page In Python is one of the most important features of all the systems.
All systems must have a login to have strong security of stored data in the system.
A Login Page In Python With Database is quite useful, and the concept and logic of the project are simple to grasp.
The source code is open source and free to use. Simply scroll down and click the download option.
Project Output:
What Is a Login Page In Python?
The Login Page Using Python is an entry page that requires users to identify themselves and prove their identity. This is usually done by entering a username and password.
The Importance of a System Login System
This Login Page In Python Tkinter With Database is what makes user accounts possible.
Most systems require unique usernames, which makes sure that every user’s login is different. On a more advanced level, logins add a layer of security between unsecured and secure activity.
Purpose Of Login Page?
The Login Page In Python With MySQL Database should be the first page people view when they open the redesigned app.
It should include two text boxes, one for a login name and the other for a password. It should also contain a command button that starts the password-checking process.
It is an error that must be reported to the user if one of the text boxes is left blank. If both fields are filled in but the user name is not recorded or the password is wrong, the user must be notified.
About the Project
The Login Page In Python is a desktop application written and designed in the Python programming language. The project is open source, and it was made for novices who wish to learn Python.
A Login Page Code In Python Tkinter is simple, but it can be useful if you are developing your system. This can be your stepping stone in developing the system you want to develop.
Additionally, this system is made in Python was designed by the Tkinter library, and uses MySQL database for storing large amounts of data.
Project Details and Technology
Project Name: | Login Page In Python |
Abstract: | This Login Page is a simple Python project designed to help IT students with their projects or assignments. This project also provides a stepping stone that can be useful if you are developing your own system. |
Language/s Used: | Python (GUI Based) |
Python version (Recommended): | 3.8 or 3.9 |
Type: | Desktop Application |
Developer: | Glenn Magada Azuelo |
Updates: | 0 |
How To Make A Log-In Page In Python?
The code given below is the full source code on Login Page In Python
Installed Libraries!
from tkinter import * import tkinter.messagebox import mysql.connector
Complete Source Code!
from tkinter import * import tkinter.messagebox import mysql.connector #connecting to the database connectiondb = mysql.connector.connect(host="localhost",user="root",passwd="",database="logindb") cursordb = connectiondb.cursor() def login(): global root2 root2 = Toplevel(root) root2.title("Account Login") root2.geometry("450x300") root2.config(bg="white") global username_verification global password_verification Label(root2, text='Please Enter your Account Details', bd=5,font=('arial', 12, 'bold'), relief="groove", fg="white", bg="blue",width=300).pack() username_verification = StringVar() password_verification = StringVar() Label(root2, text="").pack() Label(root2, text="Username :", fg="black", font=('arial', 12, 'bold')).pack() Entry(root2, textvariable=username_verification).pack() Label(root2, text="").pack() Label(root2, text="Password :", fg="black", font=('arial', 12, 'bold')).pack() Entry(root2, textvariable=password_verification, show="*").pack() Label(root2, text="").pack() Button(root2, text="Login", bg="blue", fg='white', relief="groove", font=('arial', 12, 'bold'),command=login_verification).pack() Label(root2, text="") def logged_destroy(): logged_message.destroy() root2.destroy() def failed_destroy(): failed_message.destroy() def logged(): global logged_message logged_message = Toplevel(root2) logged_message.title("Welcome") logged_message.geometry("500x100") Label(logged_message, text="Login Successfully!... Welcome {} ".format(username_verification.get()), fg="green", font="bold").pack() Label(logged_message, text="").pack() Button(logged_message, text="Logout", bg="blue", fg='white', relief="groove", font=('arial', 12, 'bold'), command=logged_destroy).pack() def failed(): global failed_message failed_message = Toplevel(root2) failed_message.title("Invalid Message") failed_message.geometry("500x100") Label(failed_message, text="Invalid Username or Password", fg="red", font="bold").pack() Label(failed_message, text="").pack() Button(failed_message,text="Ok", bg="blue", fg='white', relief="groove", font=('arial', 12, 'bold'), command=failed_destroy).pack() def login_verification(): user_verification = username_verification.get() pass_verification = password_verification.get() sql = "select * from usertable where username = %s and password = %s" cursordb.execute(sql,[(user_verification),(pass_verification)]) results = cursordb.fetchall() if results: for i in results: logged() break else: failed() def Exit(): wayOut = tkinter.messagebox.askyesno("Login System", "Do you want to exit the system") if wayOut > 0: root.destroy() return def main_display(): global root root = Tk() root.config(bg="white") root.title("Login System") root.geometry("500x500") Label(root,text='Welcome to Log In System', bd=20, font=('arial', 20, 'bold'), relief="groove", fg="white", bg="blue",width=300).pack() Label(root,text="").pack() Button(root,text='Log In', height="1",width="20", bd=8, font=('arial', 12, 'bold'), relief="groove", fg="white", bg="blue",command=login).pack() Label(root,text="").pack() Button(root,text='Exit', height="1",width="20", bd=8, font=('arial', 12, 'bold'), relief="groove", fg="white", bg="blue",command=Exit).pack() Label(root,text="").pack() main_display() root.mainloop()
By the way, if you are new to Python programming and don’t have any idea what Python IDE to use, I have here a list of the Best Python IDE for Windows, Linux, and Mac OS for you.
Additionally, I also have here How to Download and Install the Latest Version of Python on Windows.
To start executing a Login Page In Python, make sure that you have installed Python on your computer.
Steps On How To Run The Project
Time needed: 5 minutes
These are the steps on how to run Login Page In Python with Source Code
- Step 1: Download Source Code
First, find the downloadable source code below and click to start downloading the source code file.
- Step 2: Extract File
Next, after finished to download the file, go to the file location and right-click the file and click extract.
- Step 3: Open Project Path and Open CMD (Command Prompt).
In order for you to run the project, you just need to open the project path and type CMD. The first thing you need to do is type py main.py in the command prompt. After that, just wait for a few seconds to load the system.
Download the Source Code below!
Summary
This article is a way to enhance and develop our skills and logic ideas which is important in practicing the Python programming language which is the most well-known and most usable programming language in many companies.
Inquiries
If you have any questions or suggestions about the Login Page In Python, please feel free to leave a comment below.