Registration and login app made using customtkinter with simple input validation.
This includes a sqlite3 database setup with many functions including saving the registration data, logging in, password reset, security questions, country selection, and more. Change the config.py file for your details to test e-mail functions. You can get the Gmail app password HERE
- Prerequisites
- Screenshots
- User Database Functions
- UI Functions
- Installation
- Configuration
- Contributing
Before you begin, ensure you have met the following requirements:
tkinter
: You can install tkinter usingpip install tkinter
.customtkinter
: You can install customtkinter usingpip install customtkinter
.pycountry
: You can install pycountry usingpip install pycountry
.Pillow
: You can install Pillow usingpip install Pillow
.
The following functions are used for managing user data in a SQLite database.
- Opens a database connection and returns the connection and cursor.
- Closes the provided database connection.
register_user(first_name, last_name, country, username, email, password, security_question, security_answer)
- Registers a new user with the provided information.
- Returns
True
for successful registration, orFalse
if the username or email is already in use.
- Checks if the provided username and password match a record in the Users table.
- Returns
True
for a successful login, orFalse
for an unsuccessful login.
- Checks if an email address exists in the Users table.
- Returns user data if the email exists, or
None
if not found.
- Updates the user's password with a temporary password.
- Returns
True
for a successful password update, orFalse
for a failure.
- Retrieves the security question associated with the given email address.
- Returns the security question or
None
if the email is not found.
- Checks if the provided security answer matches the stored security answer associated with the email address.
- Returns
True
if the security answer matches, orFalse
if it does not.
- Validates if the provided email address follows the standard email format.
- Returns
True
for valid email addresses, orFalse
for invalid ones.
- Validates if the provided characters are english without spaces.
- Validates if the provided characters are english spaces allowed.
- Generates a random temporary password of the specified length (default is 8 characters).
- Sends a password reset email to the provided email address with the temporary password.
The following functions are used for UI-related tasks.
- A placeholder function to test button functionality.
- Toggles the visibility of a password entry field based on a Boolean variable.
- Retrieves a list of country names sorted in alphabetical order.
To install CustomTkinter-Login-Registration, follow these steps:
-
Clone this repository:
git clone https://github.com/didis97/CustomTkinter-Login-Registration.git
-
Install Imports:
pip install tkinter customtkinter pycountry Pillow
Before using the application, configure the config.py
file with your email and SMTP server details.
Contributions are welcome! Please feel free to open an issue or create a pull request.