Backend REST API for a Learning Management System (LMS) built with Django Rest Framework.
The system provides course access control based on payment status. After purchasing a course, users gain access to sections containing educational materials. Each material may include an associated test.
User registration with extended profile fields is implemented using Djoser.
Authentication supports both:
- JWT authentication
- DRF token authentication
Account registration includes email verification via confirmation email.
Data validation is implemented at multiple levels:
- serializer validation
- model validation
- database constraints
The project includes:
- unit test coverage
- automatically generated OpenAPI documentation
- configured CORS support
The project requires PostgreSQL.
Clone the repository and install dependencies:
git clone https://github.com/Lio-Kay/DRF_LMS
cd DRF_LMS/
python3 -m venv DRF_LMS
source DRF_LMS/bin/activate
pip install -r requirements.txtCreate a .env file based on .env.sample and configure environment variables.
Create a PostgreSQL database.
Run migrations and start the development server:
cd lms/
python manage.py migrate
python manage.py runserverTo populate the database with demo data, use the custom management commands described below.
OpenAPI documentation is available at:
http://127.0.0.1:8000/api/v1/schema/redoc/
python manage.py c_susrCreates a superuser with the following credentials: Email: admin@admin.com Phone: +1234567890 Password: admin
python manage.py c_usrRemoves all non-staff users and generates new test users.
python manage.py c_edudataRemoves all data from the education module and generates new sample course materials.
- lms
- accounts - User management
- education - Courses, materials and tests
- lms - Project configuration
- .env.sample - Environment configuration template
- payments - Course payment processing
- tg - Telegram bot logic
- manage.py
- .gitignore
- README.md
- requirements.txt
- Django+DRF
- djoser
- django-cors-headers
- django-filter
- django-money
- django-phonenumber-field
- djangorestframework-camel-case
- djangorestframework-simplejwt
- drf-spectacular
- Faker
- flake8
- Pillow
- psycopg2-binary
- python-dotenv
Additional Features
- 92%+ unit test coverage
- PEP8 compliant codebase
- Fully configured Django admin panel
- Automated API schema generation with drf-spectacular