This guide shows you how to run the Django Elective Management System on your local device using either Docker or directly with Python.
- Docker Images: Built and tested successfully
- Development & Production: Both configurations working
- Database: SQLite for development, PostgreSQL for production
- Issues Fixed: All Docker build and container issues resolved
- Docker installed on your system
- At least 2GB free disk space
# 1. Navigate to the project directory
cd /home/abhiyan/Elective-Management-System-1
# 2. Build the development Docker image
docker build -t elective-system-dev .
# 3. Run the development container
docker run -d --name elective-dev -p 8000:8000 elective-system-dev
# 4. Access the application
# Open your browser and go to: http://localhost:8000# 1. Navigate to the project directory
cd /home/abhiyan/Elective-Management-System-1
# 2. Build the production Docker image
docker build -f Dockerfile.prod -t elective-system-prod .
# 3. Run the production container
docker run -d --name elective-prod -p 8000:8000 elective-system-prod
# 4. Access the application
# Open your browser and go to: http://localhost:8000
# Note: Production mode redirects HTTP to HTTPS, so you might see a redirect notice# 1. Start all services
docker-compose up -d
# 2. Access the application
# Open your browser and go to: http://localhost:8000
# 3. Stop all services
docker-compose down- Python 3.11+ installed
- pip package manager
# 1. Navigate to the project directory
cd /home/abhiyan/Elective-Management-System-1/PMS
# 2. Create a virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Run database migrations
python manage.py migrate
# 5. Create a superuser account
python manage.py createsuperuser
# 6. Collect static files
python manage.py collectstatic
# 7. Start the development server
python manage.py runserver
# 8. Access the application
# Open your browser and go to: http://localhost:8000When using Docker, the system creates a default admin account:
- Username: admin
- Password: adminpassword123
- Email: admin@example.com
When running with Python directly, you'll create your own superuser account in step 5.
- Home Page: http://localhost:8000
- Admin Panel: http://localhost:8000/admin/
- Student Portal: http://localhost:8000/student/
- Course Management: http://localhost:8000/course/
- Admin Panel: Manage users, courses, and elective subjects
- Student Registration: Students can register and set elective priorities
- Algorithm Execution: Run allocation algorithms (1-5 subjects for Masters, 2 for Bachelors)
- Excel Export: Download allocation results as Excel files
- PDF Reports: Generate PDF reports for results
# View running containers
docker ps
# View all containers (including stopped)
docker ps -a
# View container logs
docker logs <container-name>
# Stop a container
docker stop <container-name>
# Remove a container
docker rm <container-name>
# View Docker images
docker images
# Remove unused images
docker image prune-
Port 8000 already in use
# Use a different port docker run -d --name elective-dev -p 8001:8000 elective-system-dev # Then access: http://localhost:8001
-
Permission denied errors
# Make sure you have proper permissions sudo docker run -d --name elective-dev -p 8000:8000 elective-system-dev -
Database issues in Python mode
# Reset the database rm pms_db.sqlite3 python manage.py migrate python manage.py createsuperuser
- Backend: Django 4.x with Python 3.11
- Database: SQLite (development) / PostgreSQL (production)
- Frontend: Django templates with Bootstrap
- Static Files: Handled by WhiteNoise in production
- Algorithm: Custom allocation algorithm for elective subjects
- Export: openpyxl for Excel, ReportLab for PDF
- Access the admin panel and set up courses and elective subjects
- Configure academic levels (Bachelor's/Master's programs)
- Add elective subjects with capacity limits
- Test student registration and priority setting
- Run the allocation algorithm to see results
The system is now fully functional and ready for use! 🎉