Skip to content

Instantly share code, notes, and snippets.

@jvorcak
Created July 17, 2015 14:05
Show Gist options
  • Save jvorcak/7f6acdd090990608afd6 to your computer and use it in GitHub Desktop.
Save jvorcak/7f6acdd090990608afd6 to your computer and use it in GitHub Desktop.
Get all tables names in a Django project
from django.db import connection
tables = connection.introspection.table_names()
seen_models = connection.introspection.installed_models(tables)
[model._meta.db_table for model in seen_models]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment