Skip to content

A comprehensive Student Management System built with Django, featuring multi-role access, real-time notifications, and secure authentication.

License

Notifications You must be signed in to change notification settings

S4NKALP/Student-Management-System-In-Django

Repository files navigation

πŸŽ“ Student Management System

Python Django License Redis PostgreSQL

A comprehensive Django-based Student Management System with modern features and robust architecture. πŸš€

✨ Features

  • πŸ” User Authentication and Authorization
  • πŸ‘¨β€πŸŽ“ Student Information Management
  • πŸ“š Course Management
  • πŸ“Š Attendance Tracking
  • πŸ“ Grade Management
  • πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ Parent Portal
  • πŸ“± Admin Dashboard
  • πŸ”₯ Firebase Integration
  • πŸ“± SMS Notifications
  • πŸ“§ Email Notifications
  • πŸ’Ύ Caching System
  • πŸ”’ Security Features
  • 🎨 Responsive UI with Jazzmin Admin Theme

πŸ› οΈ Prerequisites

  • Python 3.8 or higher
  • Redis Server
  • PostgreSQL (recommended) or SQLite
  • Firebase Account (for Firebase features)
  • SMS Gateway Account (for SMS features)

πŸ”₯ Firebase Setup

  1. Create a Firebase Project:

    • Go to Firebase Console
    • Click "Add project" and follow the setup wizard
    • Give your project a name and enable Google Analytics (optional)
  2. Get Firebase Configuration:

    • In Firebase Console, click on the gear icon (βš™οΈ) next to "Project Overview"
    • Select "Project settings"
    • Scroll down to "Your apps" section
    • Click the web icon (</>)
    • Register your app with a nickname
    • Copy the configuration object that looks like this:
    const firebaseConfig = {
      apiKey: "xxx",
      authDomain: "xxx",
      projectId: "xxx",
      storageBucket: "xxx",
      messagingSenderId: "xxx",
      appId: "xxx",
      measurementId: "xxx"
    };
  3. Set up Firebase configuration files:

    # Copy and rename the example files
    cp static/firebase-messaging-sw.example.js static/firebase-messaging-sw.js
    cp static/js/firebase-config.example.js static/js/firebase-config.js
    
    # Update the configuration in both files with your Firebase credentials
    # - In firebase-messaging-sw.js: Update the firebaseConfig object
    # - In firebase-config.js: Update both firebaseConfig and vapidKey
  4. Get Service Account Key:

    • In Project Settings, go to "Service accounts" tab
    • Click "Generate new private key"
    • Save the downloaded JSON file as firebase-key.json in your project root
    • Add this file to .gitignore to keep it secure
  5. Update Environment Variables:

    • Copy the values from your Firebase configuration to your .env file:
    FIREBASE_API_KEY=your-api-key
    FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
    FIREBASE_PROJECT_ID=your-project-id
    FIREBASE_STORAGE_BUCKET=your-project.appspot.com
    FIREBASE_MESSAGING_SENDER_ID=your-sender-id
    FIREBASE_APP_ID=your-app-id
    FIREBASE_MEASUREMENT_ID=your-measurement-id

πŸš€ Installation

  1. Clone the repository:

    git clone https://github.com/S4NKALP/Student-Management-System-In-Django.git
    cd Student-Management-System-In-Django
  2. Choose your installation method:

    Using UV (Recommended, faster):

    # Install UV if not already installed
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # UV will automatically:
    # - Create and manage virtual environment
    # - Install all dependencies
    # - Handle package versions
    # - Optimize installation process

    Using pip (Traditional method):

    # Create and activate virtual environment
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
    # Install dependencies
    pip install -r requirements.txt
  3. Set up environment variables: Create a .env file in the project root with the following variables:

    DEBUG=True
    SECRET_KEY=your-secret-key
    ALLOWED_HOSTS=localhost,127.0.0.1
    DATABASE_URL=your-database-url
    
    # Email Configuration
    EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
    DEFAULT_FROM_EMAIL=your-email@example.com
    EMAIL_HOST=smtp.gmail.com
    EMAIL_PORT=587
    EMAIL_HOST_USER=your-email@gmail.com
    EMAIL_HOST_PASSWORD=your-app-password
    EMAIL_USE_TLS=True
    
    # Firebase Configuration
    FIREBASE_API_KEY=your-api-key
    FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
    FIREBASE_PROJECT_ID=your-project-id
    FIREBASE_STORAGE_BUCKET=your-project.appspot.com
    FIREBASE_MESSAGING_SENDER_ID=your-sender-id
    FIREBASE_APP_ID=your-app-id
    FIREBASE_MEASUREMENT_ID=your-measurement-id
    
    # SMS Configuration
    SMS_API_KEY=your-sms-api-key
    SMS_SENDER_ID=your-sender-id
  4. Run migrations:

    # Create database migrations
    python manage.py makemigrations
    
    # Apply migrations
    python manage.py migrate
  5. Create a superuser:

    python manage.py createsuperuser
  6. Collect static files:

    python manage.py collectstatic

πŸƒβ€β™‚οΈ Running the Development Server

python manage.py runserver

Visit http://localhost:8000 to access the application.

πŸš€ Production Deployment

For production deployment, it's recommended to:

  1. Set DEBUG=False in your environment variables
  2. Use a production-grade database (PostgreSQL recommended)
  3. Set up proper SSL/TLS certificates
  4. Configure a production-grade web server (Nginx/Apache)
  5. Use Gunicorn as the WSGI server:
    gunicorn student_management_system.wsgi:application

πŸ“ Project Structure

student_management_system/
β”œβ”€β”€ app/                    # Main application directory
β”œβ”€β”€ static/                 # Static files (CSS, JS, images)
β”œβ”€β”€ templates/             # HTML templates
β”œβ”€β”€ student_management_system/  # Project settings
β”œβ”€β”€ manage.py              # Django management script
β”œβ”€β”€ requirements.txt       # Project dependencies
└── README.md             # This file

πŸ”’ Security Features

  • CSRF Protection
  • XSS Protection
  • SQL Injection Protection
  • Secure Password Hashing
  • Session Security
  • HTTPS Enforcement
  • Security Headers
  • Rate Limiting

πŸ“š API Endpoints

The system provides various AJAX endpoints for data exchange between the frontend and backend:

πŸ” Authentication Endpoints

  • POST /login/ - User login
  • POST /logout/ - User logout
  • POST /password-reset/ - Password reset options
  • POST /password-reset/phone/ - Phone-based password reset
  • POST /password-reset/email/ - Email-based password reset
  • POST /password-reset/set/ - Set new password

πŸ“Š Dashboard Endpoints

  • GET /app/dashboard/ - Main dashboard
  • GET /app/student-dashboard/ - Student dashboard
  • GET /app/teacher-dashboard/ - Teacher dashboard
  • GET /app/parent-dashboard/ - Parent dashboard
  • GET /app/admission-officer-dashboard/ - Admission officer dashboard
  • GET /app/hodDashboard/ - HOD dashboard

πŸ‘¨β€πŸŽ“ Student Management

  • GET /app/get-students/ - Get all students
  • GET /app/get-student/<int:student_id>/ - Get student details
  • POST /app/add-student/ - Add new student
  • PUT /app/edit-student/<int:student_id>/ - Edit student
  • DELETE /app/delete-student/<int:student_id>/ - Delete student

πŸ“š Course and Subject Management

  • GET /app/get-subjects/ - Get all subjects
  • GET /app/get-courses/ - Get all courses
  • POST /app/add-subject/ - Add new subject
  • PUT /app/edit-subject/<int:subject_id>/ - Edit subject
  • DELETE /app/delete-subject/<int:subject_id>/ - Delete subject
  • GET /app/get-course-duration/ - Get course duration
  • GET /app/get-subject-schedule/ - Get subject schedule

πŸ‘¨β€πŸ« Staff Management

  • GET /app/get-teachers/ - Get all teachers
  • POST /app/add-staff/ - Add new staff
  • GET /app/staff/<int:staff_id>/ - Get staff details
  • PUT /app/edit-staff/<int:staff_id>/ - Edit staff
  • DELETE /app/delete-staff/<int:staff_id>/ - Delete staff

🀝 Meeting Management

  • GET /app/api/meetings/<int:meeting_id>/ - Get meeting details
  • POST /app/api/meetings/add/ - Create new meeting
  • PUT /app/api/meetings/<int:meeting_id>/edit/ - Update meeting
  • POST /app/api/meetings/<int:meeting_id>/cancel/ - Cancel meeting
  • GET /app/api/meetings/<int:meeting_id>/notes/ - Get meeting notes
  • GET /app/api/meetings/<int:meeting_id>/agenda/ - Get meeting agenda

πŸ“… Routine Management

  • GET /app/api/hod/routines/<int:routine_id>/ - Get routine details
  • POST /app/api/hod/routines/ - Create new routine
  • PUT /app/api/hod/routines/<int:routine_id>/edit/ - Update routine
  • DELETE /app/api/hod/routines/<int:routine_id>/delete/ - Delete routine

πŸ“ Leave Management

  • POST /app/request-leave/ - Request student leave
  • POST /app/request-staff-leave/ - Request staff leave
  • POST /app/approve-student-leave/<int:leave_id>/ - Approve student leave
  • POST /app/approve-staff-leave/<int:leave_id>/ - Approve staff leave
  • POST /app/reject-student-leave/<int:leave_id>/ - Reject student leave
  • POST /app/reject-staff-leave/<int:leave_id>/ - Reject staff leave
  • GET /app/get-student-leaves/ - Get student leaves
  • GET /app/get-staff-leaves/ - Get staff leaves

πŸ’¬ Feedback Management

  • POST /app/submit-feedback/ - Submit student feedback
  • POST /app/submit-institute-feedback/ - Submit institute feedback
  • POST /app/submit-staff-institute-feedback/ - Submit staff institute feedback
  • POST /app/parent/feedback/submit/ - Submit parent feedback
  • POST /app/parent/feedback/institute/submit/ - Submit parent institute feedback

πŸ‘€ Profile Management

  • POST /app/update-profile/ - Update user profile
  • POST /app/change-password/ - Change password
  • POST /app/teacher-update-profile-picture/ - Update teacher profile picture
  • POST /app/teacher-change-password/ - Change teacher password

πŸ”₯ Firebase Integration

  • POST /app/saveFCMToken/ - Save Firebase Cloud Messaging token
  • GET /firebase-messaging-sw.js - Firebase service worker

πŸ“’ Notice Management

  • POST /app/add-notice/ - Add new notice
  • DELETE /app/delete-notice/<int:notice_id>/ - Delete notice
  • POST /app/hod/add-notice/ - Add HOD notice
  • GET /app/notice/<int:notice_id>/ - View notice

πŸ“Š Attendance Management

  • POST /app/save-attendance/ - Save attendance
  • GET /app/get-attendance-form/ - Get attendance form

πŸ“ˆ Progress Tracking

  • GET /app/api/get-student-progress/ - Get student progress
  • GET /app/api/get-progress/<int:progress_id>/ - Get specific progress
  • PUT /app/api/edit-progress/<int:progress_id>/ - Edit progress

πŸ“„ License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0) - see the LICENSE file for details.

πŸ’¬ Support

For support, please open an issue in the GitHub repository or contact the maintainers.