A comprehensive web-based school management system built with Django, featuring modern UI/UX design and robust functionality for managing students, teachers, grades, and academic operations.
- Features
- Models Overview
- Installation
- Configuration
- Usage
- API Endpoints
- Project Structure
- Technologies Used
- Documentation
- Contributing
- License
- Authentication System: Secure login/logout with role-based access (Staff/Student)
- User Roles: Differentiated access levels for administrators and students
- Registration: New user registration with role assignment
- Student Profiles: Comprehensive student information management
- Personal Details: Name, address, nationality, date of birth
- Academic Information: Field of study (Filière), enrollment details
- Extracurricular: Sports activities and platform preferences
- Image Upload: Student photo management
- CRUD Operations: Create, Read, Update, Delete student records
- Teacher Profiles: Complete teacher information system
- Professional Details: Academic grade, specialty, contact information
- Academic Hierarchy: Support for various academic ranks (Assistant to Professor)
- Specializations: Multiple subject specialties (Computer Science, Mathematics, etc.)
- CRUD Operations: Full teacher record management
- Module System: Course/subject management with coefficients
- Grade Management: Student grade recording and calculation
- Weighted Averages: Automatic calculation based on module coefficients
- Academic Programs: Filière (field of study) management
- Pass/Fail Status: Automatic determination based on grade thresholds
- Dashboard: Modern statistical overview with interactive charts
- Student Statistics: Gender distribution, enrollment numbers
- Grade Analytics: Performance metrics and trends
- Visual Charts: Chart.js integration for data visualization
- Responsive Design: Mobile-friendly statistical displays
- Grade Transcripts: Official academic transcript generation
- Program-based Reports: Filter by academic program
- Email Integration: Send transcripts via email
- Print Support: Print-friendly transcript layouts
- Chart Integration: Visual grade distribution charts
- Export Options: Multiple output formats
- Email System: Integrated email functionality for transcripts
- HTML Templates: Professional email templates
- Chart Attachments: Send visual charts via email
- Bulk Operations: Multiple recipient support
- Responsive Design: Mobile-first approach
- Modern Styling: CSS Grid, Flexbox, and modern CSS features
- Interactive Elements: Hover effects, transitions, and animations
- Color-coded Status: Visual indicators for pass/fail status
- Professional Templates: Clean, modern template design
- Form Validation: Client-side and server-side validation
Modern dashboard with statistics cards and interactive charts
Comprehensive student information form with modern UI
Professional transcript generation with charts and email integration
- Personal information (name, address, nationality)
- Academic details (program, enrollment)
- Extracurricular activities (sports)
- Contact information and preferences
- Image upload support
- Professional information (grade, specialty)
- Personal details (contact, address)
- Academic qualifications
- Teaching assignments
- Course/subject information
- Credit coefficients for grading
- Teaching assignments
- Program associations
- Student-module grade relationships
- Weighted grade calculations
- Pass/fail determinations
- Date tracking
- Fields of study management
- Program descriptions
- Student-program associations
- Country code management
- Nationality information
- Sports activities catalog
- Student-sport relationships
- Python 3.8 or higher
- pip (Python package installer)
- Virtual environment (recommended)
git clone https://github.com/yourusername/school-management-system.git
cd school-management-system
# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Create a .env
file in the project root:
# Database Configuration
DB_NAME=school_management
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_HOST=localhost
DB_PORT=5432
# Email Configuration
EHU=[email protected]
EMAIL_PASSWORD=your_app_password
# Django Settings
SECRET_KEY=your_secret_key_here
DEBUG=True
# Run migrations
python manage.py makemigrations
python manage.py migrate
# Create superuser
python manage.py createsuperuser
python manage.py collectstatic
python manage.py runserver
Visit http://127.0.0.1:8000
to access the application.
The project supports multiple database backends:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv('DB_NAME'),
'USER': os.getenv('DB_USER'),
'PASSWORD': os.getenv('DB_PASSWORD'),
'HOST': os.getenv('DB_HOST', 'localhost'),
'PORT': os.getenv('DB_PORT', '5432'),
}
}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
Configure SMTP settings in settings.py
:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = os.getenv('EHU')
EMAIL_HOST_PASSWORD = os.getenv('EMAIL_PASSWORD')
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
- Full access to all features
- Student and teacher management
- Grade management and statistics
- Transcript generation and email
- Limited access to bulletin/transcript viewing
- Personal information access
- Navigate to Student Management
- Click "Add New Student"
- Fill in personal and academic information
- Upload student photo (optional)
- Save the record
- Access Django Admin panel
- Navigate to Notes (Grades)
- Add grades for student-module combinations
- System automatically calculates weighted averages
- Go to PV (Transcript) section
- Select academic program (Filière)
- View generated transcript with statistics
- Email or print the transcript
- Access Statistics section
- View interactive charts and metrics
- Analyze student distribution and performance
- Etudiant: Student management interface
- Enseignant: Teacher management interface
- Tableaux: Django admin panel access
- Bulletin: Individual student transcripts
- Statistique: Statistics dashboard
- PV: Program transcripts and reports
Endpoint | Method | Description | Access Level |
---|---|---|---|
/ |
GET | Main menu/dashboard | Staff |
/login/ |
GET, POST | User authentication | Public |
/register/ |
GET, POST | User registration | Public |
/logout/ |
POST | User logout | Authenticated |
/etudiant/ |
GET, POST | Student management | Staff |
/enseignant/ |
GET, POST | Teacher management | Staff |
/bulletin/ |
GET, POST | Student bulletins | All Users |
/statistique/ |
GET | Statistics dashboard | Staff |
/pv/ |
GET, POST | Program transcripts | Staff |
/save-chart-image/ |
POST | Chart image saving | Staff |
/admin/ |
GET | Django admin panel | Superuser |
School_management/
βββ π myproject/ # Django project configuration
β βββ __init__.py
β βββ settings.py # Project settings
β βββ urls.py # URL routing
β βββ wsgi.py # WSGI configuration
βββ π myapp/ # Main application
β βββ π migrations/ # Database migrations
β βββ π templates/ # HTML templates
β β βββ π accounts/ # Authentication templates
β β βββ π myapp/ # Application templates
β β βββ base.html # Base template
β β βββ menu.html # Navigation menu
β β βββ etudiant_form.html # Student form
β β βββ enseignant_form.html # Teacher form
β β βββ statistique.html # Statistics dashboard
β β βββ pv.html # Transcript generation
β β βββ bulletin.html # Student bulletin
β β βββ html_content.html # Email template
β βββ π static/ # Static files (CSS, JS, images)
β βββ models.py # Database models
β βββ views.py # View functions
β βββ forms.py # Django forms
β βββ admin.py # Admin interface
β βββ urls.py # App URL patterns
βββ π media/ # User uploaded files
βββ requirements.txt # Python dependencies
βββ Pipfile # Pipenv configuration
βββ manage.py # Django management script
βββ .env # Environment variables
βββ README.md # This file
- Django 5.1.3: Web framework
- Python 3.8+: Programming language
- PostgreSQL: Database (production)
- SQLite: Database (development)
- HTML5: Markup language
- CSS3: Styling with modern features (Grid, Flexbox)
- JavaScript: Client-side functionality
- Chart.js: Interactive charts and graphs
- Pillow: Image processing
- python-dotenv: Environment variable management
- django-debug-toolbar: Development debugging
- WeasyPrint: PDF generation
- gunicorn: WSGI HTTP Server
- whitenoise: Static file serving
- Git: Version control
- pip: Package management
- Pipenv: Virtual environment management
DEBUG=False
SECRET_KEY=your_production_secret_key
ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
python manage.py collectstatic --noinput
python manage.py migrate
gunicorn myproject.wsgi:application --bind 0.0.0.0:8000
- Create
Procfile
:
web: gunicorn myproject.wsgi
- Configure environment variables in Heroku dashboard
- Deploy using Heroku CLI or GitHub integration
This project includes comprehensive documentation to help developers and administrators:
- Configuration Guide - Detailed setup and configuration instructions
- API Documentation - Complete API reference with models, views, and endpoints
- Testing Guide - Comprehensive testing procedures and test cases
- Deployment Guide - Production deployment instructions for various environments
- Installation: See CONFIGURATION.md for detailed setup
- API Reference: Check API_DOCUMENTATION.md for all endpoints
- Testing: Follow TESTING_GUIDE.md for comprehensive testing
- Deployment: Use DEPLOYMENT_GUIDE.md for production setup
- Step-by-step installation guides
- Complete API endpoint documentation
- Database schema and relationships
- Security best practices
- Performance optimization tips
- Troubleshooting guides
- Testing procedures and checklists
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- Follow PEP 8 for Python code
- Use meaningful variable and function names
- Add comments for complex logic
- Write unit tests for new features
- Update documentation as needed
# Run tests
python manage.py test
# Check code coverage
coverage run --source='.' manage.py test
coverage report
This project is licensed under the MIT License - see the LICENSE file for details.
- Django community for the excellent framework
- Chart.js for interactive charting capabilities
- Contributors and testers who helped improve this project