def django_table_names(self, only_existing=False):
    '\n        Returns a list of all table names that have associated Django models and\n        are in INSTALLED_APPS.\n\n        If only_existing is True, the resulting list will only include the tables\n        that actually exist in the database.\n        '
    from django.db import models, router
    tables = set()
    for app in models.get_apps():
        for model in models.get_models(app):
            if (not model._meta.managed):
                continue
            if (not router.allow_syncdb(self.connection.alias, model)):
                continue
            tables.add(model._meta.db_table)
            tables.update([f.m2m_db_table() for f in model._meta.local_many_to_many])
    if only_existing:
        tables = [t for t in tables if (self.table_name_converter(t) in self.table_names())]
    return tables
Returns a list of all table names that have associated Django models and
are in INSTALLED_APPS.

If only_existing is True, the resulting list will only include the tables
that actually exist in the database.
def django_table_names(self, only_existing=False):
    '\n        Returns a list of all table names that have associated Django models and\n        are in INSTALLED_APPS.\n\n        If only_existing is True, the resulting list will only include the tables\n        that actually exist in the database.\n        '
    from django.db import models, router
    tables = set()
    for app in models.get_apps():
        for model in models.get_models(app):
            if (not model._meta.managed):
                continue
            if (not router.allow_syncdb(self.connection.alias, model)):
                continue
            tables.add(model._meta.db_table)
            tables.update([f.m2m_db_table() for f in model._meta.local_many_to_many])
    if only_existing:
        tables = [t for t in tables if (self.table_name_converter(t) in self.table_names())]
    return tables