How to get all table names in a Django app?
I use the following code but it doesn’t get the tables created by ManyToManyField
from django.db.models import get_app, get_models
app = get_app(app_name)
for model in get_models(app):
print model._meta.db_table
This will give you all of the table names, like the OP asks for:
This will give you all model names:
This will give you all of the model names on a per app basis:
Additional reading
And yet another recommends reading this answer:
Django get list of models in application