This project implements an authentication feature for a web application, storing user data in a database MongoDB.
-
Listen on localhost:5000: The application listens on
localhost:5000
(or the address shown in terminal). -
Authentication Form: An authentication form is rendered at
http://localhost:5000
. -
Redirection: Upon successful authentication, the user is redirected to profile page at
http://localhost:5000/profile
. -
Data Storage: Usernames and passwords are stored in MongoDB.
Profile will be shown with data respected to each account:
-
Password hashing: Passwords will be hashed before being saved to the database.
-
Logout: When logging out, the page will be redirected to the login confirmation page.
- Python (Programming Language)
- Flask (Web Framework)
- MongoDB(Database)
- bcrypt (Password Hashing)
- HTML, CSS, JavaScript (Frontend)
-
Clone the Repository:
git clone https://github.com/itmo-wad/TranNgocHuan-HW2.git
-
Navigate to the Project Directory:
cd [project directory name]
-
Install Dependencies:
pip install Flask pymongo bcrypt
-
Database Setup: MongoDB: Ensure MongoDB is running and configure the connection URI in Python code.
-
Run the Application:
py app.py
-
Access the application: Open your web browser and navigate to http://localhost:5000 (or the address shown in terminal).