Elearning platform where you can find existing courses, subscribe to them or create your own new courses.
This project use Redis for caching. You have to have it installed.
What things you need to install the software and how to install them
Django 2.0+
Django Rest Framework
Redis
more in requirements.txt
Download a fixture with some Subjects:
loaddata initial_data.json
Run Redis server
$ sudo service redis_6379 start
API prefix:
/api/
Show all available subjects.
/subjects/
GET
--
--
Code: 200
Content example:
[
{
"id": 2,
"title": "Mathematics",
"slug": "mathematics"
},
{
"id": 4,
"title": "Music",
"slug": "music"
},
]
--
Show details for 1 selected subject
/subjects/:id
GET
--
--
Code: 200
Content example:
[
{
"id": 2,
"title": "Mathematics",
"slug": "mathematics"
}
]
--
Show all available courses
/subjects/elearning
GET
--
--
Code: 200
Content example:
[
{
"id": 2,
"subject": 4,
"title": "This is some course",
"slug": "this_is_some_course",
"overview": "Good description for good course",
"created": "2018-05-29T17:32:39.751099Z",
"owner": 1,
"modules": [
{
"order": 0,
"title": "This is first big Module",
"description": "This is starting module"
},
},
{...another course...}
]
--
Subscribe to the course
/subjects/elearning/:id/enroll
POST
--
{
u : {
user : [string],
password : [alphanumeric],
}
}
Code: 200
Content example:
{'enrolled': True}
HTTP 401: Unauthorized
HTTP 403: Forbidden
{
"detail": "You do not have permission to perform this action."
},
{
"detail": "Authentication credentials were not provided."
}
HTTP 405: Method Not Allowed
{
"detail": "Method \"GET\" not allowed."
}
Show the content of the selected course
/subjects/elearning/:id/conents
GET
--
--
Code: 200
Content example:
{
"id": 2,
"subject": 4,
"title": "This is good course",
"slug": "this_is_good_course",
"overview": "Good description for good course",
"created": "2018-05-29T17:32:39.751099Z",
"owner": 1,
"modules": [
{
"order": 0,
"title": "This is first big Module",
"description": "This is starting module",
"contents": [
{
"order": 0,
"item": "<p>Text for students go study.</p>"
},
{
"order": 1,
"item": "<p><img src=\"/media/images/6_model.jpg\" height=\"200\"></p>"
}
]
}
]
}
HTTP 401: Unauthorized
HTTP 403: Forbidden
{
"detail": "You do not have permission to perform this action."
},
{
"detail": "Authentication credentials were not provided."
}
You need to have a permission to add new courses. You need have Instructors permissions. You can change the permission group on the admin page.