This Flask-based web application allows users to register, log in, update their profile information (city, profession, and profile picture), change passwords, and log out. The application uses MongoDB as the database and supports secure password hashing with bcrypt.
- User authentication (registration, login, logout)
- Profile update (city, profession, and profile picture)
- Secure password storage using bcrypt
- Session-based authentication
- Flash messages for user feedback
Ensure you have the following installed on your system:
- Python 3
- MongoDB
- pip (Python package manager)
git clone https://github.com/Yessir11/yessir_hw2_itmo_wad.git
cd yessir_hw2_itmo_wad
python -m venv venv
source venv/bin/activate # On macOS/Linux
venv\Scripts\activate # On Windows
This project requires the following Python libraries:
Flask
pymongo
bcrypt
Werkzeug
To install manually, run:
pip install Flask pymongo bcrypt Werkzeug
- Connect to MongoDB shell:
mongo
- Create the database and collection:
use itmo_wad_hw2 db.createCollection("users")
python3 app.py
The application will run on http://localhost:5000/
flask-profile-management/
│── static/
│ ├── styles.css
│ ├── uploads/ # Folder for user profile pictures
│── templates/
│ ├── login.html
│ ├── registration.html
│ ├── profile.html
│ ├── updateInfo.html
│── app.py
│── README.md

- User passwords are securely hashed using bcrypt.
- Default profile pictures are used if users do not upload one.
- Users can update either one or both profile fields (city and profession) independently.
- The
UPLOAD_FOLDER
is set tostatic/uploads
to store profile pictures.
Registration Page

Authentication of the created user

Database

Profile Page

Edit User Information and upload photo

Information Updated

Password Changed

For any issues or improvements, feel free to contribute!
Yessir GOUTON