A simple Student Management System built with Django, supporting full CRUD (Create, Read, Update, Delete) operations on student records through a web interface.
- View a list of all students on the home page
- Add a new student (name, roll number, age, class)
- Update an existing student's details
- Delete a student record
- Django admin panel support for managing data directly
- Backend: Python, Django
- Database: SQLite (
db.sqlite3) - Frontend: Django templates (HTML)
SMS-main/
├── Student_Mgmt_sytem/ # Django project (settings, urls, wsgi/asgi)
│ ├── settings.py
│ ├── urls.py
│ ├── wsgi.py
│ └── asgi.py
├── home/ # Main app
│ ├── models.py # Student model
│ ├── views.py # index, create, update, delete views
│ ├── admin.py
│ └── migrations/
├── templates/
│ ├── base.html
│ ├── index.html # Student list
│ ├── create.html # Add student form
│ ├── update.html # Edit student form
│ ├── detail.html
│ └── includes/navbar.html
├── db.sqlite3
└── manage.py
The Student model (home/models.py) includes:
| Field | Type |
|---|---|
name |
CharField |
age |
PositiveSmallIntegerField |
Class |
CharField |
roll |
IntegerField |
| URL | View | Description |
|---|---|---|
/ |
index |
List all students |
/create/ |
create |
Add a new student |
/update/<id>/ |
update |
Edit a student's details |
/delete/<id>/ |
delete |
Delete a student |
/admin/ |
Django admin | Manage data via the built-in admin panel |
- Python 3.x
- pip
# Clone the repository
git clone https://github.com/<your-username>/SMS.git
cd SMS
# (Recommended) create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install Django
pip install django
# Apply migrations
python manage.py migrate
# (Optional) create an admin user
python manage.py createsuperuser
# Run the development server
python manage.py runserverThen open http://127.0.0.1:8000/ in your browser.
- The included
db.sqlite3contains any data from development/testing — delete it and re-runpython manage.py migratefor a clean database. - The
createview checks for avisitedcookie (set on the home page) before allowing new students to be added — visit the home page (/) first if you land directly on/create/. __pycache__folders are compiled Python bytecode and aren't required to run the project; they're safe to remove and are typically excluded via.gitignore.
- Add form validation and error handling
- Add search/filter functionality for the student list
- Add authentication so only logged-in users can manage records
- Replace raw
POST.get()calls with Django Forms/ModelForms