Skip to content

Lio-Kay/DRF_LMS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

306 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DRF LMS Backend

Python Django PostgreSQL Tests

Overview

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

Project Setup

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.txt

Create 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 runserver

To 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/

Custom Management Commands

python manage.py c_susr

Creates a superuser with the following credentials: Email: admin@admin.com Phone: +1234567890 Password: admin

python manage.py c_usr

Removes all non-staff users and generates new test users.

python manage.py c_edudata

Removes all data from the education module and generates new sample course materials.

Project Structure

  • 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

Technologies

  • 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

About

Django REST Framework backend for an LMS platform with JWT authentication, course access control, payments and PostgreSQL database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors