Code Reference

Glossary

Django · Reference cheat sheet

Glossary

Django · Reference cheat sheet


📋 Overview

Alphabetical glossary of core Django terms for models, views, templates, auth, and the request/response cycle.

🔧 Core concepts

TermDefinition
AdminThe built-in CRUD interface generated from registered models.
AppA self-contained Django package under INSTALLED_APPS with models/views.
ASGIAsync server gateway interface used for async Django and Channels.
AuthenticationVerifying who a user is, typically via sessions or tokens.
CSRFCross-Site Request Forgery protection built into Django forms/middleware.
FieldA model attribute that maps to a database column and validation rules.
FormA class that validates and cleans submitted input data.
Management commandA CLI task run with python manage.py <command>.
ManagerThe interface attached to models for building QuerySets (objects).
MiddlewareHooks that process requests and responses globally.
MigrationA versioned schema change applied to the database.
ModelA Python class mapping to a database table via the ORM.
MVTModel–View–Template, Django’s primary architectural pattern.
ORMObject-relational mapper that turns model APIs into SQL.
PermissionA flag controlling whether a user may perform an action.
ProjectThe top-level Django configuration package created by startproject.
QuerySetA lazy, chainable representation of a database query.
RequestThe HttpRequest object representing an incoming HTTP call.
SerializerDRF component that converts models to/from JSON (and validates).
SettingsProject configuration module (settings.py / env-driven values).
SignalA dispatcher that notifies receivers when certain actions occur.
Static filesCSS, JS, and images collected and served separately from media uploads.
TemplateAn HTML file with Django template language tags and filters.
URLConfThe URL routing table mapping paths to views.
ViewA callable that takes a request and returns a response.
WSGIWeb Server Gateway Interface used by traditional sync Django deploys.

💡 Examples

Model and QuerySet:

class Post(models.Model):
    title = models.CharField(max_length=200)
    published = models.BooleanField(default=False)

Post.objects.filter(published=True).order_by("-id")

URL and view:

# urls.py
path("posts/<int:pk>/", views.post_detail, name="post_detail")

# views.py
def post_detail(request, pk):
    post = get_object_or_404(Post, pk=pk)
    return render(request, "posts/detail.html", {"post": post})

Migration workflow:

python manage.py makemigrations
python manage.py migrate

⚠️ Pitfalls

  • Confusing project (site config) with app (feature package).
  • Mixing Form validation with Serializer validation in DRF projects.
  • Treating a QuerySet as immediately executed — it is lazy until evaluated.
  • Equating authentication (who you are) with permission (what you may do).
  • Assuming static files and media uploads are the same storage path.

On this page