Django Study Guide Day1 To Day3
Django Study Guide Day1 To Day3
Day 3)
DAY 1
1. What is Django?
Explanation:
Django is a Python web framework that lets you build websites quickly with less code. It
follows the MVT (Model-View-Template) architecture. It comes with built-in tools like
admin panel, authentication, ORM, and more.
Theory Questions:
1. What is Django?
2. What language is Django written in?
3. What architecture does Django follow?
4. Is Django open-source?
5. Which companies use Django?
Practical Questions:
1. Install Django and create a project.
2. Run Django server and open localhost:8000.
3. Create a new app in Django.
4. Register the app in settings.py.
5. Explore the Django folder structure.
---
2. Features of Django
Explanation:
- Fast development
- Secure (built-in protection from attacks)
- Scalable
- Portable (runs anywhere)
- Admin panel
- ORM support
- Reusable apps
Theory Questions:
1. List any three Django features.
2. What helps Django interact with the database?
3. Why is Django secure?
4. What does the admin panel do?
5. Is Django good for big apps?
Practical Questions:
1. Create a model and access it in admin.
2. Use ORM to add and fetch data.
3. Set up static files in Django.
4. Create and use templates.
5. Add built-in authentication.
---
3. What is a Framework?
Explanation:
A framework is a pre-built structure for developing apps faster. Django provides a ready-
made system to build websites instead of building everything from scratch.
Theory Questions:
1. What is a software framework?
2. Name two Python frameworks.
3. What kind of framework is Django?
4. Framework vs Library?
5. Why use frameworks?
Practical Questions:
1. Create a Django project.
2. Explore files created by startproject.
3. Add and configure a new app.
4. Use a built-in feature like admin.
5. Compare raw Python project with Django.
---
Theory Questions:
1. What is the architecture of Django?
2. What does Model do?
3. Role of View?
4. What part handles UI?
5. How does data flow in Django?
Practical Questions:
1. Create a model.
2. Create a view.
3. Create a template and connect to view.
4. Use model data in the template.
5. Create a full flow: URL → View → Template.
---
5. MVT vs MVC
Explanation:
- Django uses MVT (Model, View, Template)
- MVC = Model, View, Controller
Theory Questions:
1. What does MVT stand for?
2. What is the Controller in Django?
3. Difference between Template and View?
4. Is Django using MVC or MVT?
5. Why is MVT useful?
Practical Questions:
1. Create full MVT flow.
2. Create two templates and switch views.
3. Print model data in template.
4. Use class-based view instead of function.
5. Create another app with same pattern.
---
6. What is HTTP?
Explanation:
HTTP (HyperText Transfer Protocol) is the protocol used to transfer data between browser
and server. It's stateless.
Theory Questions:
1. What is HTTP?
2. Is HTTP stateful?
3. Who uses HTTP?
4. What are HTTP methods?
5. How does a browser communicate with a server?
Practical Questions:
1. Send GET request in browser.
2. Create a Django view to return HTML.
3. Use Postman to send POST request.
4. Inspect network tab in browser.
5. Return JSON response in Django.
---
7. HTTP Methods
Explanation:
- GET: Read data
- POST: Create data
- PUT: Replace data
- PATCH: Update partial data
- DELETE: Remove data
Theory Questions:
1. Name five HTTP methods.
2. Which method updates data?
3. GET vs POST?
4. Which method deletes?
5. Are methods case-sensitive?
Practical Questions:
1. Create a view for GET and POST.
2. Use Postman for PATCH request.
3. Use curl to DELETE.
4. Handle PUT in DRF view.
5. Log method type in view.
---
8. HTTP Request Format
Explanation:
- Request line: Method, URL, HTTP version
- Headers: Info about request
- Body: Only for POST/PUT/PATCH
Theory Questions:
1. Parts of HTTP request?
2. Is body included in GET?
3. What are headers for?
4. What does request line contain?
5. Where is form data?
Practical Questions:
1. View request in browser dev tools.
2. Print headers in Django view.
3. Read form data from POST.
4. Inspect request in Postman.
5. Log full request.
---
Theory Questions:
1. Parts of HTTP response?
2. What is in status line?
3. What does header contain?
4. Can response have no body?
5. Meaning of 404?
Practical Questions:
1. Return HTML response.
2. Return JSON using JsonResponse.
3. Check headers in browser.
4. Test response in Postman.
5. Set custom header.
---
Theory Questions:
1. CRUD full form?
2. What does POST do?
3. Which method deletes?
4. Difference between PUT and PATCH?
5. What maps to READ?
Practical Questions:
1. Create views for CRUD.
2. Test with Postman.
3. Form with POST to create data.
4. Update using PUT.
5. Delete using DELETE.