๐Ÿ“น Digital Attendance System - Testing & Demo Guide

๐Ÿ“ฆ Current Database Overview

๐Ÿ” Temporary Secret Storage (for Testing Only)

๐Ÿงช Testing Steps (Sequential)

1. Register Users
Endpoint: POST /api/auth/register/

a. Register a Teacher

{ "username": "demo_teacher", "email": "demo_teacher@example.com", "password": "Test@123", "role": "teacher" }

b. Register a Student

{ "username": "demo_student", "email": "demo_student@example.com", "password": "Test@123", "role": "student" }
2. Login
Endpoint: POST /api/auth/token/
{ "username": "demo_teacher", "password": "Test@123" }
3. Create Classroom
Endpoint: POST /api/classrooms/
Header: Authorization: Bearer <teacher_token>
{ "name": "Physics", "subject": "Science" }
4. Enroll Student
Endpoint: POST /api/classrooms/{id}/enroll/
Header: Authorization: Bearer <student_token>
5. Generate QR Session
Endpoint: POST /api/attendance/classrooms/{id}/generate-session/
Header: Authorization: Bearer <teacher_token>
6. Mark Attendance
Endpoint: POST /api/attendance/mark/
Header: Authorization: Bearer <student_token>
{ "session_id": "<uuid-from-generated-session>" }
7. Student Summary
Endpoint: GET /api/attendance/student/{student_id}/summary/
8. Class Summary
Endpoint: GET /api/attendance/class/{class_id}/summary/
9. Export CSV
Endpoint: GET /api/attendance/class/{class_id}/export/
10. (Optional) Date Range Filter
Endpoint: GET /api/attendance/class/{id}/summary/?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD

๐Ÿ“ง Email Notification Test (Absent Student)

This test triggers an email notification to a student who is marked absent for a class session. Run the following script inside your Django project's shell:

python .\manage.py shell
from users.models import User
from classroom.models
import Classroom from attendance.utils
import send_absence_alert
student = User.objects.get(username='demo_student')
teacher = User.objects.filter(role='teacher').first()
classroom = Classroom.objects.create(name='ai 106', subject='aii', teacher=teacher)
send_absence_alert(student, classroom)

Expected Outcome: The specified student (gajanan) receives an email informing them about their absence in the ai 106 class.

๐Ÿ› ๏ธ Admin Panel Access

You can access the Django admin dashboard to manage classrooms, sessions and attendance records at:

URL: https://digital-attendance-system-28f1.onrender.com/admin/

Login Credentials:

After logging in, you'll be able to view and modify all models such as Users, Classrooms, Sessions, and Attendance Records directly from the web interface.