Web Lab 05
Web Lab 05
Session: Special
Course: Web Technologies
Instructor: Dr. Sanam Ahmed
Teacher Assistants
Eisha Mehmood (BITF21M019)
Minahil Fakhar (BITF21M002)
Anas Irfan (BITF21M047)
Lab 05, Time Duration: 1.5hr
Objective:The goal of this lab is to develop a simple web application that enables users to sign
up and log in using Python Flask. By the end of this lab, students will understand how to
implement user authentication and connect the application to a database.
Task Description:
In this lab, you will create a basic user authentication system that includes both a sign-up and a
login page. The task will involve setting up a Flask application, creating the necessary HTML
forms, validating user input, and storing user data securely in a SQLite database.
1. Sign-Up Page:
○ The sign-up page will allow new users to create an account by providing their first
name, last name, username, email, and password.
○ Password should contain a capital, a small, a special character and of 8 characters
long .
○ After successful registration, the user will be redirected to the login page.
2. Login Page:
○ The login page will allow registered users to log in by entering their username and
password.
Page 1 of 3
○ Upon successful login, the user will be redirected to a homepage that welcomes
the authenticated user.
○ If the login fails, appropriate error messages will be displayed.
Database Setup:
● Create the necessary tables in the MySQL database using pymysql. The users table
should include columns for id, first_name, last_name, username, email, and
password.
Page 2 of 3
Page 3 of 3