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

Django Basics Interview QA

Django is a high-level Python web framework that promotes rapid development and follows the MVT architecture, enabling the creation of secure and scalable web applications. Key features include built-in authentication, ORM, an admin panel, middleware support, and robust security measures. The project structure consists of a main directory with configuration files and app directories containing models, views, and templates for handling requests and responses.

Uploaded by

wankhedeanand19
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)
11 views2 pages

Django Basics Interview QA

Django is a high-level Python web framework that promotes rapid development and follows the MVT architecture, enabling the creation of secure and scalable web applications. Key features include built-in authentication, ORM, an admin panel, middleware support, and robust security measures. The project structure consists of a main directory with configuration files and app directories containing models, views, and templates for handling requests and responses.

Uploaded by

wankhedeanand19
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 Basics - Interview Questions and Answers

What is Django?
Django is a high-level Python web framework that encourages rapid development and clean,
pragmatic design. It follows the MVT (Model-View-Template) architecture and helps
developers build secure, scalable, and maintainable web applications efficiently.

What are the key features of Django?


- MVT Architecture: Separates business logic from presentation.
- Built-in Authentication: User authentication and authorization system.
- ORM (Object-Relational Mapping): Interacts with the database using Python classes.
- Admin Panel: Auto-generated backend interface for managing models.
- Middleware Support: Processes requests before they reach the view.
- Security: Protects against SQL Injection, XSS, and CSRF attacks.
- Scalability: Can handle high traffic with proper optimizations.

Explain the Django project structure.


When you create a Django project, you get the following structure:

myproject/
manage.py # Command-line utility for Django
myproject/ # Main project directory
__init__.py # Marks directory as a Python package
settings.py # Configuration settings
urls.py # URL routing
wsgi.py # Entry point for WSGI servers
app_name/ # Django app (created separately)
models.py # Database models
views.py # View functions or class-based views
urls.py # App-specific URLs
templates/ # HTML templates
static/ # Static files (CSS, JS, images)

What is MVT (Model-View-Template) in Django?


MVT is Django's software architecture pattern:
- Model: Defines the database structure (tables and relationships).
- View: Handles business logic and returns HTTP responses.
- Template: Handles presentation and user interface.

How does Django handle requests?


Django processes requests in the following way:
1. User makes a request (e.g., https://example.com/home)
2. Django's URL dispatcher (urls.py) matches the request to a view function.
3. The view processes the request and interacts with the model (database) if needed.
4. The view returns a response, often rendered using a template.
5. The response is sent to the user's browser.

You might also like