Django’s primary design philosophy
DRY (Don’t Repeat Yourself)
The architectural pattern Django follows
MTV (Model-Template-View)
Django component representing the data structure
Model
Django component handling the UI/presentation layer
Template
Django component containing the business logic
View
Command to create a new Django project
django-admin startproject <name></name>
Command to create a new app within a project
python manage.py startapp <name></name>
The core configuration file for a Django project
settings.py
The file used to define URL patterns
urls.py
Standard library for building Web APIs in Django
Django REST Framework (DRF)
Command to create migration files based on model changes
python manage.py makemigrations
Command to apply migrations to the database
python manage.py migrate
Default database used by Django for local development
SQLite
Recommended database for Django production environments
PostgreSQL
The built-in tool for managing data models via a GUI
Django Admin
Middleware protection against forged requests
CSRF (Cross-Site Request Forgery) protection
Python object used to query the database in Django
QuerySet
The method to retrieve a single object from a Model
Model.objects.get()
The method to retrieve multiple objects from a Model
Model.objects.filter()
Function used to convert a URL name into a path
reverse()
Template tag used for URL routing
{% url ‘name’ %}
Purpose of ‘context’ in a Django view
A dictionary passed to the template to render data
Standard interface for Django to communicate with web servers
WSGI (Web Server Gateway Interface)
Standard interface for asynchronous Django applications
ASGI (Asynchronous Server Gateway Interface)