In this project I implemented a basic web feature for web application with data stored in MongoDB.
-
Create MongoDB Database :
Set up a MongoDB database to store user credentials (login and password)
-
Render Authentication Form :
- Create a new HTML template to render the authentication form. - Implement a route in Flask (/login) to render this template when the user accesses the root URL (http://localhost:5000/).
-
Handle Authentication:
- Implementitation of logic in the /login route to handle form submission.
- Retrieve the entered username and password from the form.
- Querying the MongoDB collection to find a user with the provided username and Verify the password.
-
Show Profile Page:
- Creation of profile.html for authenticated user only.
- Implementation of a route (/profile) to render this template.
For unauthenticated user :
1- install flask (pip install flask)
2- install MongoDB and create a database name wadhw2 and collection : users
3- insert data (name and password in the database)
2- clone the repository of the project
3- navigate to the repository and run the command : python3 app.py
4- Reach the website on http://localhost:5000
KPADEDJI Emmanuel