A modern, feature-rich e-learning platform built with Django and Django REST Framework. This platform enables instructors to create and manage courses while allowing students to learn at their own pace with progress tracking.
- Create and manage courses with detailed information
- Organize course content into modules
- Support for multiple content types:
- Text content
- Video content
- Image content
- File attachments
- Set course pricing (free or paid)
- Track student progress and engagement
- Cloud-based media storage with Cloudinary
- Browse available courses
- Access course content with progress tracking
- Track completion status for individual content items
- Video progress tracking (resume from last position)
- Course completion tracking
- Progress percentage calculation
- Modern and responsive user interface
- Backend Framework: Django & Django REST Framework
- Frontend: HTML, CSS, JavaScript with modern UI components # Not ready
- Database: PostgreSQL (recommended)
- Authentication: Django's built-in authentication system
- Media Storage: Cloudinary for cloud-based media storage
- API Documentation: DRF Spectacular
- Python 3.8+
- pip (Python package manager)
- Virtual environment (recommended)
- PostgreSQL (recommended) or SQLite
- Cloudinary account (for media storage)
The platform includes a real-time chat server for course discussions and support.
- Real-time messaging using Django Channels and WebSockets
- Each course has its own chat room
- Instructors and students can send and receive messages instantly
- Message history is stored and can be retrieved
-
Start the Django development server (as usual):
python manage.py runserver
-
Start the Channels worker (for handling WebSockets):
# If using Daphne (recommended for production) daphne core.asgi:application # Or for development/testing, you can use runserver (Channels will be enabled automatically) python manage.py runserver
ws://<your-domain>/ws/chat/<course_slug>/- Connect to a course chat room e-learning/ ├── chat/ # Real-time chat server and consumers │ ├── consumers.py # WebSocket consumers for chat │ ├── models.py # Chat message models │ ├── routing.py # WebSocket routing │ └── views.py # Chat-related views
Note:
Since the application runs using ASGI (for real-time features like chat), the default Django file upload mechanism may not work as expected.
To support file uploads, you need to set up a separate WSGI-compatible web server (such as Gunicorn or uWSGI) or use a reverse proxy (like Nginx) to handle file uploads and serve static/media files.Recommendation:
- Use Daphne or Uvicorn for ASGI (WebSockets, chat, etc.)
- Use Nginx as a reverse proxy to route HTTP requests (including file uploads) to a WSGI server and WebSocket requests to the ASGI server.
- See Django documentation on Deploying with ASGI and WSGI.
- Clone the repository:
git clone https://github.com/yourusername/e-learning.git
cd e-learning- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt-
Configure your environment variables:
- Create a
.envfile in the project root - Add your Cloudinary credentials:
CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret
- Create a
-
Configure your database settings in
settings.py -
Run migrations:
python manage.py migrate- Create a superuser:
python manage.py createsuperuser- Run the development server:
python manage.py runservere-learning/
├── courses/ # Main app for course management
│ ├── models.py # Database models
│ ├── views.py # API views
│ ├── serializers.py # API serializers
│ └── tests/ # Test cases
├── core/ # Core functionality
├── media/ # User-uploaded files
├── static/ # Static files
└── manage.py # Django management script
GET /api/docs/swagger/- Swagger UI DocumentationGET /api/docs/redoc/- ReDoc DocumentationGET /api/docs/schema/- OpenAPI Schema
POST /auth/register/- Register new userPOST /auth/login/- User loginPOST /auth/logout/- User logout
GET /api/v1/content/courses/- List all coursesPOST /api/v1/content/courses/- Create a new courseGET /api/v1/content/courses/{slug}/- Get course detailsPUT /api/v1/content/courses/{slug}/- Update courseDELETE /api/v1/content/courses/{slug}/- Delete course
GET /api/v1/content/courses/{slug}/modules/- List course modulesPOST /api/v1/content/courses/{slug}/modules/- Create new moduleGET /api/v1/content/modules/{slug}/- Get module detailsPUT /api/v1/content/modules/{slug}/- Update moduleDELETE /api/v1/content/modules/{slug}/- Delete module
GET /api/v1/content/modules/{slug}/contents/- List module contentsPOST /api/v1/content/modules/{slug}/contents/- Create new contentGET /api/v1/content/contents/{slug}/- Get content detailsPUT /api/v1/content/contents/{slug}/- Update contentDELETE /api/v1/content/contents/{slug}/- Delete content
GET /api/v1/student/courses/- List available coursesGET /api/v1/student/courses/{slug}/- Get course detailsGET /api/v1/student/contents/{slug}/- Get content details
GET /api/v1/student/courses/{slug}/progress/- Get course progressGET /api/v1/student/contents/{slug}/progress/- Get content progressPOST /api/v1/student/contents/{slug}/progress/- Update content progress
POST /api/v1/enrollment/enroll/{slug}/- Enroll in a courseGET /api/v1/enrollment/enrolled-courses/- List enrolled courses
Run the test suite:
python manage.py testRun specific test cases:
python manage.py test courses.tests.test_progress- Fork the repository
- Create your 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
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue in the GitHub repository or contact the maintainers.
The platform uses Cloudinary for media storage, providing:
- Secure cloud storage for all media files
- Automatic image optimization
- Video streaming capabilities
- CDN delivery for faster content loading
- Automatic backup and versioning
To configure Cloudinary:
- Sign up for a Cloudinary account
- Get your credentials from the Cloudinary dashboard
- Add them to your
.envfile - The platform will automatically handle media uploads to Cloudinary