Login and New User Registration Project Using Flask and Flask-SQLAlchemy - phpMyAdmin
Welcome to the Flask Authentication Project This project demonstrates user login and user registration functionalities using Flask and Flask-SQLAlchemy. It includes user authentication, session management, and secure password handling.
- App Initialization: Creates and configures the Flask application with SQLAlchemy for database interactions.
- Secret Key: Generates a secure key for session management.
- Database Configuration: Connects to a MySQL database named 'users_db'.
- User Model: Defines user details with fields for first name, last name, email, and password.
- Index Route: Displays the home page if the user is logged in, otherwise redirects to the login page.
- Register Route: Manages user registration, including password validation and database insertion.
- Login Route: Handles user login by verifying credentials and managing user sessions.
- Logout Route: Logs out the user by clearing the session and redirects to the login page.