Fake Data Generator for SMS
This directory contains a Django management command to generate fake data for testing the School Management System (SMS).
Prerequisites
Before using this script, make sure you have installed the required packages:
pip install faker
Usage
Run the command using Django's manage.py:
python manage.py generate_fake_data
Options
The script accepts the following optional parameters:
--students: Number of students to create (default: 50)--staff: Number of staff members to create (default: 20)--parents: Number of parents to create (default: 40)--courses: Number of courses to create (default: 5)--subjects: Number of subjects per course (default: 4)--clear: Clear existing data before generating new data (flag)
Examples
Generate data with default parameters:
python manage.py generate_fake_data
Generate a smaller dataset:
python manage.py generate_fake_data --students 20 --staff 10 --parents 15
Clear existing data and generate new data:
python manage.py generate_fake_data --clear
Generated Data
The script generates the following types of data:
- Institute information
- Batches (last 4 years)
- Courses with customized names and durations
- Subjects for each course
- Staff members with profiles and credentials
- Students with profiles and course assignments
- Parents linked to students
- Class routines and schedules
- Attendance records for past week
- Notices/announcements
- Leave requests for students and staff
- Feedback (student, parent, institute)
- Parent-teacher meetings
- Course tracking records
Login Credentials
The generated users have the following default passwords:
- Students:
student123 - Staff:
staff123 - Parents:
parent123
Note
The script doesn't generate actual file content for subject files due to the limitation of creating binary content programmatically. This portion is commented out in the code.