A Django-based application for managing students, teachers, classes, attendance, announcements, and results.
- Features
- Prerequisites
- Installation & Local Setup
- Configuration
- Running in Development
- Deployment to Production
- Customisation
- Contributing
- License
- User authentication (admin, teachers, parents)
- CRUD for Students, Teachers, Classes, Subjects
- Attendance tracking & reports
- Announcements & news articles with images
- Result management & transcripts
- Python 3.10+
- pip (or
pipenv/poetry) - Git
- PostgreSQL (or any other RDBMS supported by Django)
- (For production) Gunicorn, Nginx
-
Clone repository
git clone https://github.com/zamaex96/SchoolManagementSystem.git cd SchoolManagementSystem -
Create virtual environment
python -m venv .venv .venv\Scripts\activate # Windows source .venv/bin/activate # macOS/Linux
-
Install dependencies
pip install -r requirements.txt
-
Environment variables
Copy.env.exampleto.env, then set:SECRET_KEY=your-django-secret-key DEBUG=True DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/DB_NAME -
Database migrations & superuser
python manage.py migrate python manage.py createsuperuser
In settings.py (or via env vars):
DEFAULT_AUTO_FIELDDEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
- Database
EnsureDATABASES['default']['ENGINE']matches your RDBMS. - Static & Media
STATIC_URL = '/static/' MEDIA_URL = '/media/'
python manage.py runserverVisit http://127.0.0.1:8000/.
Admin interface: http://127.0.0.1:8000/admin/
-
Install production dependencies
pip install gunicorn whitenoise psycopg2-binary
-
Settings adjustments
DEBUG = False ALLOWED_HOSTS = ['yourdomain.com'] MIDDLEWARE = [ 'whitenoise.middleware.WhiteNoiseMiddleware', # ... ] STATIC_ROOT = BASE_DIR / 'staticfiles'
-
Collect static files
python manage.py collectstatic
-
Gunicorn & Nginx
- Gunicorn command:
gunicorn school_system.wsgi:application --bind 0.0.0.0:8000
- Configure Nginx to proxy
127.0.0.1:8000and serve/static/fromstaticfiles/.
- Gunicorn command:
-
Process manager
Use systemd or Supervisor to keep Gunicorn alive.
- Adding new models:
- Define in
core/models.py - Register in
core/admin.py makemigrations→migrate
- Define in
- Overriding templates:
Place custom templates intemplates/mirroring app structure. - Custom settings:
Createsettings_local.py, import in main settings.
- Fork the repository
- Create feature branch:
git checkout -b feature/YourFeature - Commit changes & push:
git push origin feature/YourFeature
- Open a Pull Request
Please follow PEP 8 and include tests for new functionality.
This project is licensed under the MIT License. See LICENSE for details.
Feel free to adjust any paths or settings to suit your environment.
