0% found this document useful (0 votes)
3 views2 pages

Task 3 Django

The document outlines a series of Django development tasks, including creating models for Classroom, Course, School, and Exam with full CRUD operations. It also specifies the implementation of pagination for list endpoints, user authentication using JWT, an endpoint for exam statistics, and a user creation notification signal. Additionally, it includes authorization limits for user profiles and superuser access.

Uploaded by

hmag425
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Task 3 Django

The document outlines a series of Django development tasks, including creating models for Classroom, Course, School, and Exam with full CRUD operations. It also specifies the implementation of pagination for list endpoints, user authentication using JWT, an endpoint for exam statistics, and a user creation notification signal. Additionally, it includes authorization limits for user profiles and superuser access.

Uploaded by

hmag425
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

📋 Task-3: Django Development Tasks

1️⃣ Models CRUD Operations


Create the following models and implement full CRUD operations (Create, Read,
Update, Delete) for each:

●​ Classroom
●​ Course
●​ School
●​ Any other related models as needed

2️⃣ New Model: Exam


Create a new model called Exam with the following fields:

●​ file: Upload file (Learn how to handle file uploads in Django).


●​ course: ForeignKey to Course model (Define the relationship between Exam
and Course when creating this model).

3️⃣ Pagination
Add pagination support for all list endpoints, including:

●​ Classroom list
●​ Course list
●​ School list
●​ Exam list
4️⃣ Authentication & Authorization (JWT)
Implement user authentication & authorization using JWT:

●​ Users can login and logout.


●​ Each user can only see their own exams.
●​ Superusers can see all exams.

5️⃣ Exam Statistics Endpoint (Aggregation)


Create a GET endpoint that lists all courses, and for each course, calculate and return the
number of exams attached to that course using aggregate.

6️⃣ Authorization Limits & Profile Endpoint


●​ Each user can only view their own profile.
●​ Superusers can view all profiles through the same profile endpoint.
●​ Design one endpoint /profile/ to handle both cases (regular user vs. superuser).

7️⃣ Signals - User Creation Notification


Create a signal that triggers each time a new user is created:

●​ Send an email to the admin notifying them about the new user (e.g., [email protected]
just registered).
●​ Note: This will currently block the process until the email is sent (synchronous).
●​ This blocking will be fixed in the next session using background tasks (e.g., Celery).

You might also like