Models, ORM, views, and the Django interview essentials.
Preview — first 3 of 137 cards
Project vs app
A project is the top-level configuration (settings, root urls, wsgi/asgi). An app is a reusable component with models/views/templates. One project contains many apps; apps can be reused across projects.
django-admin startproject myproject
cd myproject
python manage.py startapp blog
Settings module
DJANGO_SETTINGS_MODULE points to settings. Common pattern: split into base/dev/prod and import. Never commit SECRET_KEY; load from env. DEBUG must be False in production.
import os
SECRET_KEY = os.environ['DJANGO_SECRET_KEY']
DEBUG = os.environ.get('DEBUG', 'False') == 'True'
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split(',')
INSTALLED_APPS
Lists enabled apps. Order matters for template, static, and translation discovery, and for overriding commands/signals. It does NOT matter for migrations, which follow dependencies. Include third-party apps (rest_framework, django.contrib.*). Apps must be importable.
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'rest_framework',
'blog.apps.BlogConfig',
]
134 more cards in this sheet
Unlock the Backend, Databases & AI bundle — ₹399
One-time payment. Unlocks this sheet and 14 other sheets in the bundle, plus a typeset PDF of each.
Unlock the bundle
See all bundles
Or get all 76 sheets for ₹999 — one payment, every future sheet included.