To create and initialize the db file:
python3 manage.py makemigrations
python3 manage.py migrate
To run the server and start listening to a port and serving requests:
python3 manage.py runserver 0.0.0.0:8000
To load professors data from excel file: it will store them inside the db file, do not run this command on further runs.
python3 manage.py import_professors professors/management/commands/golestan_courses_4022.xlsx
POST
/api/accounts/signup/
body:
{
"fullname": "Hani12",
"student_number": "S1228921d21d1c",
"email": "[email protected]",
"national_code": "1d21d8920123c",
"department": "Computer Science",
"password1": "securePassword123",
"password2": "securePassword123"
}
POST
/api/accounts/login/
body:
{
"email": "[email protected]",
"password": "securePassword123"
}
PUT
/api/accounts/users/9/edit/
Replace the 9 with desired user id
body:
{
"fullname": "edited by themself"
}
headers: token should be a superuser token to allow editing others
Authorization: Token df2cdd517e39dec5d6ce32c97bf2efa77f619b7c
DELETE
/api/accounts/users/9/delete/
Replace the 9 with desired user id
body:
Empty
headers: token should be a superuser token to allow deletion
Authorization: Token df2cdd517e39dec5d6ce32c97bf2efa77f619b7c
POST
/api/accounts/users/9/make-superuser/
Replace the 9 with desired user id
body:
Empty
headers: token should be a superuser token to allow promotion
Authorization: Token df2cdd517e39dec5d6ce32c97bf2efa77f619b7c
GET
/api/accounts/users/
body:
Empty
GET
/api/accounts/test_token/
body:
Empty
headers:
Authorization: Token df2cdd517e39dec5d6ce32c97bf2efa77f619b7c
POST
/api/professors/add_comment/
body:
{
"professor_id": 555,
"text": "Hello fellow comment"
}
headers:
Authorization: Token df2cdd517e39dec5d6ce32c97bf2efa77f619b7c
GET
/api/professors/<int:id>/
body:
Empty
GET
/api/courses/
body:
Empty
POST
/api/courses/
body:
{
"course_name_fa": "برنامه نویسی",
"course_name_en": "Programming",
"professor_id": 600,
"faculty_en": "Computer Engineering",
"faculty_fa": "مهندسی کامپیوتر",
"first_day_of_week": 0,
"first_day_time": "12:00",
"first_day_duration": 2,
"second_day_of_week": 2,
"second_day_time": "14:00",
"second_day_duration": 1.5,
"exam_date": "2024-01-15",
"exam_start_time": "09:00",
"exam_duration": 2
}
headers:
Authorization: Token df2cdd517e39dec5d6ce32c97bf2efa77f619b7c
PATCH
/api/courses/1/
Replace the 1 with desired course id
body:
{
"first_day_of_week": 2,
"exam_duration": 2
}
headers:
Authorization: Token df2cdd517e39dec5d6ce32c97bf2efa77f619b7c
GET
/api/courses/1/
Replace the 1 with desired course id
body:
Empty
GET
/api/professors/faculties/
body:
Empty
GET
/api/courses/?professor=558
Replace the 558 with desired professor id
body:
Empty
GET
/api/courses/?faculty=Computer Engineering
Replace the Computer engineering with desired faculty name
body:
Empty