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

Django Interview Question (Practical)

The document outlines practical Django interview questions across three levels: Basic, Medium, and Advanced. Basic tasks include creating a project, defining models, and implementing views and templates, while Medium tasks focus on user authentication, blog functionality, and form handling. Advanced tasks involve building a REST API, implementing JWT authentication, and optimizing database queries within a multi-app project structure.

Uploaded by

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

Django Interview Question (Practical)

The document outlines practical Django interview questions across three levels: Basic, Medium, and Advanced. Basic tasks include creating a project, defining models, and implementing views and templates, while Medium tasks focus on user authentication, blog functionality, and form handling. Advanced tasks involve building a REST API, implementing JWT authentication, and optimizing database queries within a multi-app project structure.

Uploaded by

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

Django Interview Question(Practical)

A.Basic Level :
 Create a new Django project and a single app.
 Define a model for a Book with fields: title, author, and
publication date.
 Create views to list all books and show details of a
selected book.
 Set up URL routing for both views above.
 Use Django admin to add/edit/delete Book objects.
 Create a simple HTML template to render book details.
 Add static CSS to style the book listing page.
 Display a welcome message on the homepage using a
Django view.
 Use {% for %} and {% if %} template tags to iterate
over books and show a message if none exist.
 Implement a contact form using Django's forms.Form.
 Validate the contact form and print form data to the
console.
 Connect the form to a view and show submitted data on
a thank-you page.

B. Medium Level:
 Create a Blog model with title, content, author, and
created_at.
 Implement a ModelForm for creating/editing blog posts.
 Set up login/logout functionality using Django’s built-in
auth system.
 Restrict blog post creation to logged-in users only.
 Implement custom user registration.
 Use Django messages framework to show success/failure
messages.
 Add file/image upload functionality to the blog (e.g., a
featured image).
 Create a search form to filter blog posts by keyword.
 Add pagination to the blog listing view.
 Create a comment system using ForeignKey relationships.
 Implement a dashboard page that shows the current user’s
blog posts.
 Customize the admin interface with search fields and list
filters.

C. Advance Level:
 Build a REST API for a ToDo app using Django REST
Framework (DRF).
 Implement JWT-based authentication for the API.
 Add custom permissions so only the owner of a task can
edit/delete it.
 Create a management command that sends a daily report
of new users.
 Use select_related() and prefetch_related() to optimize
DB queries.
 Set up a multi-app project (e.g., users, projects,payment)
with clear separation.
 Create a signal that sends a welcome email after user
registration.
 Implement role-based access control (admin, staff,
member) using Django groups.

You might also like