Skip to content

Glossary

Terms from the Django course and Notes Chat App. Sorted alphabetically (by English letter).


A

Term Explanation
annotate An ORM method that adds a computed field to every object in a QuerySet (for example, Count, Sum) without N+1 queries
ASGI Asynchronous Server Gateway Interface — an async-capable Python web interface required for WebSocket and the async runtime. It replaces WSGI for real-time applications
AsyncWebsocketConsumer The Django Channels base class for an async WebSocket consumer (the counterpart of View for HTTP)
Authentication Verifying who the user is (login / session)
AuthMiddlewareStack Django Channels middleware that reads the session cookie from the WS handshake and populates scope["user"]
Authorization Verifying what the user is allowed to do (object-level permission)
auto_now_add A DateTimeField parameter: records the current time only when the object is created

C

Term Explanation
CASCADE An on_delete behavior: when the parent object is deleted, all related child objects are deleted too
channel group A logical group of Channels channels; group_send sends an event to every member of the group
channel layer The Django Channels pub/sub layer — passes messages between Consumer instances (InMemory or Redis)
CheckConstraint A database-level constraint: checks a Q expression on INSERT/UPDATE. For example, Q(priority__gte=1)
Consumer A Channels class that handles the WebSocket lifecycle (connect / receive / disconnect)
CSRF Cross-Site Request Forgery — an attack in which another site makes the browser send an unwanted POST on behalf of a logged-in user
Crispy Forms A Django package for Bootstrap-styled form rendering via the {% crispy %} tag, the crispy filter, and FormHelper

D

Term Explanation
database_sync_to_async A Channels decorator/wrapper: runs a synchronous ORM function in the Django thread pool from an async context
DEBUG A Django setting: True — detailed error pages; False — a 500 without a traceback. Never True in production
Deployment Running the application on a server for real users
Django app A Django module with models, views, forms, templates; registered in INSTALLED_APPS
Django project A package with settings.py, root urls, wsgi.py/asgi.py; it wraps one or more apps
docker compose A tool for orchestrating multiple Docker containers via docker-compose.yml

E

Term Explanation
entrypoint.sh A shell script that runs when a Docker container starts: migrate → collectstatic → seed → exec server
event loop The asyncio mechanism for running coroutines; one per process; must not be blocked by synchronous calls

F

Term Explanation
ForeignKey A model field: a foreign key to another table. The on_delete parameter defines the behavior when the parent record is deleted
Form A Django class for validating and rendering input fields. ModelForm is a form based on a model

G

Term Explanation
Group Django built-in: django.contrib.auth.models.Group; used for group sharing of notes and for chat

H

Term Explanation
health check Docker: a container readiness condition (for example, pg_isready for PostgreSQL); other services wait for it before starting

I

Term Explanation
IDOR Insecure Direct Object Reference — access to someone else's object by changing the pk in the URL without an ownership check
InMemoryChannelLayer A channel layer without Redis; suitable for single-process development; does not pass messages between different Uvicorn workers
index (DB) A database data structure that speeds up SELECTs on certain fields. In Django — models.Index in Meta.indexes

L

Term Explanation
lazy evaluation A QuerySet does not run SQL until it is iterated or explicitly converted (list(), bool(), len())
login_required A Django decorator: redirects an anonymous user to /accounts/login/

M

Term Explanation
ManyToManyField A model field: a many-to-many relationship through an intermediate junction table
Middleware An intermediate layer between the request and the view (or the view and the response): processes every request/response
Migration A versioned description of a database schema change; generated by makemigrations, applied by migrate
Model A Python class that describes a database table and a domain entity

N

Term Explanation
N+1 problem An antipattern: 1 query for the list + N queries for each element. Solved with select_related or prefetch_related
Nginx A reverse proxy and web server: accepts HTTP/WebSocket requests and proxies them to the ASGI server

O

Term Explanation
on_delete An FK parameter: the behavior when the parent record is deleted. CASCADE — delete the children; SET_NULL — set to null
ORM Object Relational Mapper: a layer for working with the database through Python objects without SQL

P

Term Explanation
prefetch_related An ORM optimization: runs a separate SELECT for related objects (M2M or reverse FK) and caches the result
primary key (pk) A unique identifier of a record in a table. In Django — an automatic id = AutoField unless specified otherwise
ProtocolTypeRouter An ASGI router: dispatches traffic by protocol type (http → Django, websocket → Channels)

Q

Term Explanation
Q object A Django ORM object for complex WHERE conditions with the operators | (OR), & (AND), ~ (NOT)
QuerySet A lazy object that describes a database query; it is materialized on iteration or list()

R

Term Explanation
Redis An in-memory key-value store: used as the channel layer to pass WS messages between consumer instances
related_name An FK/M2M parameter: the name of the reverse relation. related_name='notes' → notebook.notes.all()
reverse proxy A server (Nginx) that accepts external requests and passes them to the internal ASGI server

S

Term Explanation
scope Channels: a dict with connection metadata (the counterpart of request in HTTP). Contains user, url_route, headers
select_related An ORM optimization: runs an SQL JOIN for FK and OneToOne fields; loads related objects in a single query
Selector A function in selectors.py responsible only for SELECT/read queries with access rules
Service A function in services.py responsible for a business operation and data mutation
Session Server-side state linked to the browser through the sessionid cookie; stores the authenticated user
SET_NULL An on_delete behavior: the FK field is set to NULL instead of CASCADE when the parent record is deleted
socket_timeout A RedisChannelLayer CONFIG parameter: None = no timeout. Without it, Redis will close an idle connection → TimeoutError
StaticLiveServerTestCase A Django class for Selenium tests: starts a real server and serves static files

T

Term Explanation
Template An HTML file with Django template language {{ }} and {% %} tags
TestCase A Django test class: wraps each test in a transaction (rollback after each test)
Transaction A group of DB operations that either completes entirely or is rolled back; guarantees integrity
TransactionTestCase A Django class: does not wrap tests in a transaction → data is visible from all threads. Required for async consumer tests

U

Term Explanation
unique_together Meta.unique_together or UniqueConstraint: a combination of fields is unique within the table
URLRouter Channels: routes WebSocket connections to a Consumer by URL pattern
Uvicorn A Python ASGI server: runs the Django ASGI application. In the docker stack: uvicorn notes_project.asgi:application

V

Term Explanation
View A handler for an HTTP request/response. FBV (function) or CBV (class). Notes Chat App mostly uses FBVs

W

Term Explanation
WebsocketCommunicator A channels.testing class for unit-testing a WebSocket consumer without a real browser or server
WebSocket A protocol: a long-lived bidirectional connection between the browser and the server (unlike HTTP request/response)
worker thread A separate thread in the Django thread pool where database_sync_to_async runs synchronous ORM code
WSGI Web Server Gateway Interface: the classic sync Python web interface. Does not support WebSocket