Simple solution:
import django.apps
django.apps.apps.get_models()
By default apps.get_models() don’t include
- auto-created models for many-to-many relations without
an explicit intermediate table - models that have been swapped out.
If you want to include these as well,
django.apps.apps.get_models(include_auto_created=True, include_swapped=True)
Prior to Django 1.7, instead use:
from django.db import models
models.get_models(include_auto_created=True)
The include_auto_created parameter ensures that through tables implicitly created by ManyToManyFields will be retrieved as well.