#Django

28 posts

Django Advanced #1: Async views and ASGI
8 min read

Django Advanced #1: Async views and ASGI

Django's async camp — async def view, ORM's a-prefixed methods, async middleware, sync_to_async/async_to_sync, and ASGI servers.

Docker in Practice #2: Django + PostgreSQL compose — Two Containers as One
9 min read

Docker in Practice #2: Django + PostgreSQL compose — Two Containers as One

Bundling a Django app and PostgreSQL into one docker compose file. Migration entrypoint, depends_on relying on healthcheck, data volumes, .env separation, and collectstatic — a production-shaped compose setup.

Django Intermediate #7: Testing — Django TestCase, fixtures, pytest-django
8 min read

Django Intermediate #7: Testing — Django TestCase, fixtures, pytest-django

TestCase and Client, fixtures vs factory_boy, the fixture model of pytest-django — Django ecosystem testing tools, all in one place.

Django Intermediate #6: Static/Media Operations and Storage Backends
8 min read

Django Intermediate #6: Static/Media Operations and Storage Backends

The difference between STATIC_* and MEDIA_*, the meaning of collectstatic, and storage backends like S3/WhiteNoise — the place where development crosses over to production.

Django Intermediate #5: Messages / Sessions / Cookies
7 min read

Django Intermediate #5: Messages / Sessions / Cookies

Flash messages, sessions for state between requests, and the cookies beneath them — including security attributes like HttpOnly/Secure/SameSite, all in one place.

Django Intermediate #4: Users/Permissions — custom user model, permission, group
7 min read

Django Intermediate #4: Users/Permissions — custom user model, permission, group

AUTH_USER_MODEL must be decided at project start — AbstractUser vs AbstractBaseUser, the email-login pattern, and the permission/group system.

Django Intermediate #3: Signals and Middleware
7 min read

Django Intermediate #3: Signals and Middleware

Events outside the model flow — Signals — and Middleware that crosses the request/response pipeline. Where to use these two powerful but trap-laden tools, and how to use them sparingly.

Django Intermediate #2: ORM Advanced — annotate, aggregate, F/Q, prefetch_related
8 min read

Django Intermediate #2: ORM Advanced — annotate, aggregate, F/Q, prefetch_related

The proper Django ORM tools — aggregation, expressions, complex conditions, relation prefetch. The N+1 problem and how to solve it.

Django Intermediate #1: Class-Based Views in Depth
8 min read

Django Intermediate #1: Class-Based Views in Depth

From FBV to CBV — Generic CBVs (ListView/DetailView/CreateView/UpdateView/DeleteView), Mixin patterns, and the override points you need to know.

Django Basics #7: Django Admin and Built-in Authentication
7 min read

Django Basics #7: Django Admin and Built-in Authentication

Django Admin auto CRUD UI, ModelAdmin customization, the built-in User model, login_required and permissions — all in one place.

Django Basics #6: Forms and ModelForm
8 min read

Django Basics #6: Forms and ModelForm

Validation, error display, and CSRF in one Django Form, auto-generate forms from models with ModelForm, and the file-upload pattern.

Django Basics #5: Templates and Static Files
8 min read

Django Basics #5: Templates and Static Files

Django template syntax (variables/tags/filters), template inheritance, and handling static files (CSS/JS/images) — all in one place.