🌍 Python · subject

Python Django Syllabus

Every chapter and topic of Django examined in Python — 4 chapters, 16 topics and 48 sub-topics, plus 55 flashcards written against it.

4Chapters
16Topics
48Sub-topics
~20hEst. first pass
7%Of Python
55Flashcards

Django syllabus — full chapter and topic list

Expand any chapter to see its topics and sub-topics. This is the whole examinable outline for Django in Python, not a summary of it.

  1. Introduction to Django

    2 topics
    • What is Django?
      • History and Background
      • Advantages of Django
      • Django vs Other Frameworks
    • Setting up Django
      • Installing Python
      • Installing Django
      • Creating a Django Project
      • Understanding Project Structure
  2. Django Basics

    5 topics
    • Django Apps
      • Creating an App
      • App Structure
    • Django Models
      • Defining Models
      • Model Fields
      • Model Methods
      • Database Migrations
    • Django Views
      • Function-Based Views
      • Class-Based Views
      • Generic Views
    • Django Templates
      • Template Syntax
      • Template Inheritance
      • Template Tags and Filters
    • Django URLs
      • URLconf
      • Path and Re_path
      • Including Other URLconfs
  3. Advanced Django Concepts

    5 topics
    • Django Forms
      • Form Classes
      • Form Validation
      • Model Forms
    • Django Admin
      • Customizing Admin Interface
      • Admin Actions
      • Admin Filters
    • Django Authentication
      • User Model
      • Authentication Views
      • Permissions and Authorization
    • Django Middleware
      • Built-in Middleware
      • Custom Middleware
    • Django REST Framework
      • Serializers
      • Views and ViewSets
      • Routers
      • Authentication and Permissions
  4. Deployment and Maintenance

    4 topics
    • Deployment Options
      • Deploying on Heroku
      • Deploying on AWS
      • Deploying on DigitalOcean
    • Security Best Practices
      • Securing Django Applications
      • Common Security Vulnerabilities
    • Performance Optimization
      • Database Optimization
      • Caching Strategies
      • Asynchronous Tasks
    • Testing in Django
      • Unit Tests
      • Integration Tests
      • Test Coverage

Django flashcards for Python

20 of 55 cards from the Django deck — real questions with worked answers.

  1. What is Django and what design philosophy does it follow?

    Django is a high-level, open-source Python web framework that encourages rapid development and clean, pragmatic design. It follows the 'batteries-included' philosophy (ships with ORM, admin, auth, etc.) and the DRY (Don't Repeat Yourself) principle.

  2. Which architectural pattern does Django use, and how does it differ from classic MVC?

    Django uses the MVT (Model-View-Template) pattern. Model = data layer, View = business logic, Template = presentation. It maps to MVC where Django's 'View' is MVC's Controller and Django's 'Template' is MVC's View; the framework itself acts as the controller routing requests.

  3. Who maintains Django and under what license is it released?

    Django is maintained by the Django Software Foundation (DSF) and is released under the 3-clause BSD license.

  4. What command starts a new Django project and what command starts a new app?

    django-admin startproject projectname creates a project; python manage.py startapp appname creates an app within the project.

  5. What is the role of manage.py in a Django project?

    manage.py is a command-line utility that lets you interact with the project: running the dev server (runserver), migrations, creating apps, opening the shell, and running tests. It sets DJANGO_SETTINGS_MODULE automatically.

  6. What is the difference between a Django 'project' and a Django 'app'?

    A project is the entire web application and its configuration. An app is a self-contained, reusable module that does one thing (e.g., a blog, polls). A project can contain many apps, and an app can be reused across projects.

  7. How do you run Django's built-in development server, and on what default address/port?

    python manage.py runserver — it serves by default at http://127.0.0.1:8000. You can override with e.g. runserver 0.0.0.0:8080.

  8. Which setting registers an app so Django knows about it, and where does the AppConfig live?

    Add the app (or its AppConfig path, e.g. 'polls.apps.PollsConfig') to INSTALLED_APPS in settings.py. The AppConfig class lives in the app's apps.py.

  9. What is a Django Model and what does each model class typically map to?

    A Django Model is a Python class (subclassing django.db.models.Model) that defines the structure of stored data. Each model class maps to a single database table, and each model attribute (field) maps to a column.

  10. Name five common Django model field types and what they store.

    CharField (short text, needs max_length), TextField (large text), IntegerField (integers), BooleanField (True/False), DateTimeField (date+time). Others: EmailField, ForeignKey, DecimalField.

  11. How do you create a one-to-many relationship between two Django models?

    Use a ForeignKey field on the 'many' side pointing to the 'one' side, e.g. author = models.ForeignKey(Author, on_delete=models.CASCADE). on_delete is required.

  12. What do ManyToManyField and OneToOneField represent in Django models?

    ManyToManyField represents a many-to-many relationship (Django creates a join table automatically). OneToOneField represents a one-to-one relationship, often used to extend another model (e.g. a Profile extending User).

  13. What are the two commands needed to apply model changes to the database in Django?

    python manage.py makemigrations (creates migration files from model changes) and python manage.py migrate (applies those migrations to the database).

  14. What does on_delete=models.CASCADE do on a ForeignKey, and name two alternatives.

    CASCADE deletes the referencing object when the referenced object is deleted. Alternatives: PROTECT (prevents deletion), SET_NULL (sets the FK to NULL, requires null=True), SET_DEFAULT, and DO_NOTHING.

  15. What is the Django ORM and what does QuerySet lazy evaluation mean?

    The ORM (Object-Relational Mapper) lets you query the database using Python objects instead of SQL. QuerySets are lazy: no database query runs until the QuerySet is actually evaluated (iterated, sliced, len(), list(), etc.).

  16. How do you retrieve all objects, filter, and get a single object with the Django ORM?

    Model.objects.all() returns all rows; Model.objects.filter(field=value) returns a filtered QuerySet; Model.objects.get(pk=1) returns a single object (raises DoesNotExist or MultipleObjectsReturned).

  17. What is the purpose of the Meta inner class in a Django model? Give two example options.

    The Meta class configures model-level options (not fields). Examples: ordering = ['-created'] (default ordering), verbose_name, db_table, unique_together / constraints, and abstract = True.

  18. What is a Django View and what are the two main styles of writing views?

    A view is a Python function or class that takes an HttpRequest and returns an HttpResponse. The two styles are Function-Based Views (FBVs) and Class-Based Views (CBVs, which use inheritance and mixins for reusability).

  19. What is the minimal signature of a Django function-based view, and what must it return?

    def my_view(request, *args, **kwargs): — it receives an HttpRequest as the first argument and must return an HttpResponse object (or subclass like JsonResponse, or raise Http404).

  20. Name three commonly used Django generic class-based views and their purpose.

    ListView (display a list of objects), DetailView (display a single object), CreateView/UpdateView/DeleteView (CRUD forms), TemplateView (render a template), RedirectView (redirect).

See more Django flashcards →

Planning Django for Python

Django is about 7% of the Python syllabus by topic count — 16 of 242 topics, spread over 4 chapters. At roughly 45 minutes per topic plus 12 minutes per sub-topic, a first pass runs to about 20 hours.

The heaviest chapters are Django Basics (5 topics), Advanced Django Concepts (5 topics), Deployment and Maintenance (4 topics) . Front-load those while your energy is high; the short chapters are better revision filler later.

Work top-down: read the chapter, then tick topics off individually rather than marking the whole chapter done. Sub-topics are where silent gaps hide.

Django (Python) FAQ

What is in the Python Django syllabus?

Django is split into 4 chapters — Introduction to Django, Django Basics, Advanced Django Concepts and Deployment and Maintenance, containing 16 topics and 48 sub-topics in total.

How is Django structured in the Python syllabus?

4 chapters. Django accounts for about 7% of the topics in the whole Python syllabus (16 of 242).

How long should I spend on Django for Python?

Budget around 20 hours for a first pass through Django — about 45 minutes per topic plus 12 minutes per sub-topic across its 16 topics. Add revision cycles on top.

Are there flashcards for Python Django?

Yes — a 55-card Django deck. Sample cards are printed on this page, and the full deck is free in the Examius app with spaced repetition scheduling.