A Django-based web application for automated attendance tracking using face recognition technology, along with notes management system.
- Multi-role Authentication: Students, Faculty, and Admin roles
- Face Recognition: Automated attendance marking using live camera
- Manual Attendance: Traditional checkbox-based attendance marking
- Notes Management: Faculty can upload notes, students can download
- Dashboard: Role-based dashboards with attendance analytics
- Responsive Design: Bootstrap 5 with mobile-first approach
- Backend: Django 4.2 + Django REST Framework
- Frontend: Django Templates + Bootstrap 5 + Vanilla JavaScript
- Face Recognition: face_recognition (dlib) + OpenCV + NumPy
- Database: SQLite (development) / PostgreSQL (production ready)
- Storage: Django Media for uploaded files
- Python 3.8+
- pip
- Virtual environment (recommended)
Note for Windows users: The face_recognition library requires Visual Studio Build Tools or Visual Studio Community with C++ development tools.
-
Clone the repository ```bash git clone cd smart-attendance-mvp ```
-
Create and activate virtual environment ```bash python -m venv venv
venv\Scripts\activate
source venv/bin/activate ```
-
Install dependencies ```bash pip install -r requirements.txt ```
-
Set up environment variables (optional) Create a
.envfile in the project root: ``` SECRET_KEY=your-secret-key-here DEBUG=True ``` -
Run database migrations ```bash python manage.py makemigrations python manage.py migrate ```
-
Create superuser ```bash python manage.py createsuperuser ```
-
Load demo data (optional) ```bash python manage.py seed_demo ```
-
Run the development server ```bash python manage.py runserver ```
-
Access the application
- Open http://127.0.0.1:8000 in your browser
- Admin panel: http://127.0.0.1:8000/admin
- Sign up with role "Student" and provide roll number
- Upload face images in Profile section for face recognition
- View attendance statistics on dashboard
- Download notes uploaded by faculty
- Sign up with role "Faculty"
- Create attendance sessions
- Mark attendance manually or use live camera recognition
- Upload notes for students
- View attendance reports
- Manage users, subjects, and view system-wide analytics
- Post announcements
- Generate attendance reports
- Upload Face Images: Students must upload clear face photos in their profile
- Camera Permissions: Allow camera access when using live recognition
- Lighting: Ensure good lighting for better recognition accuracy
- Distance: Maintain 2-3 feet distance from camera for optimal results
POST /api/upload-face/- Upload face image for recognitionPOST /api/recognize/- Process camera frame for face recognitionPOST /api/mark-manual/- Manual attendance markingGET /api/attendance/student/<id>/- Get student attendance data
In config/settings.py:
FACE_RECOGNITION_THRESHOLD = 0.45- Recognition confidence thresholdFACE_RECOGNITION_TOLERANCE = 0.6- Face matching tolerance
- Set
DEBUG = False - Configure PostgreSQL database
- Set up proper media file serving (AWS S3, etc.)
- Use HTTPS for camera access
- Configure proper CORS settings
-
Face recognition library installation fails
- Install Visual Studio Build Tools (Windows)
- Install cmake:
pip install cmake
-
Camera not working
- Check browser permissions
- Ensure HTTPS in production
- Try different browsers
-
No face detected
- Ensure good lighting
- Face should be clearly visible
- Try different angles
-
Poor recognition accuracy
- Upload multiple face images
- Adjust
FACE_RECOGNITION_THRESHOLDin settings - Ensure consistent lighting conditions
``` smart-attendance-mvp/ ├── config/ # Django settings ├── users/ # User management app ├── attendance/ # Core attendance app ├── templates/ # HTML templates ├── static/ # CSS, JS, images ├── media/ # Uploaded files ├── scripts/ # Database scripts └── requirements.txt ```
- Create new Django apps for major features
- Follow the existing code structure
- Add appropriate tests
- Update documentation
This project is created for educational and hackathon purposes.
For issues and questions, please check the troubleshooting section or create an issue in the repository.