A simple Flask web application to manage student records with MongoDB as the backend database. Users can add, view, update, and delete student details.
- List all students on the home page
- Add a new student
- Update existing student details
- Delete a student with confirmation
- Simple and responsive UI using Bootstrap
- Backend: Python, Flask
- Database: MongoDB (via Flask-PyMongo)
- Frontend: HTML, Jinja2 templates, Bootstrap 5
- Environment Variables: Managed via
.envfile
git clone <your-repo-url>
cd <repo-folder>python -m venv venv
# Activate venv
# Windows:
venv\Scripts\activate
# Linux / Mac:
source venv/bin/activatepip install -r requirements.txtrequirements.txt example:
Flask
Flask-PyMongo
python-dotenv
bson
Create a .env file in the project root:
MONGO_URI=<your-mongodb-connection-string>
SECRET_KEY=<your-secret-key>
python app.pyOpen your browser at: http://localhost:8000
project/
│
├── templates/
│ ├── base.html
│ ├── index.html
│ ├── add_student.html
│ ├── update_student.html
│
├── app.py
├── requirements.txt
└── .env
Home Page Lists all students with Edit/Delete buttons.
Add Student Form to add a new student.
Update Student Form pre-filled with student details.
- Make sure MongoDB is running and accessible via the URI in
.env - Delete action includes a confirmation page to prevent accidental deletion
- Uses
ObjectIdfrombsonto work with MongoDB document IDs
MIT License


