def django_models(self, metadata_source=None):
        sql = self.sql(dialect='postgresql', inserts=False, creates=True,
            drops=True, metadata_source=metadata_source)
        u = sql.split(';\n')

        try:
            import django
        except __HOLE__:
            print('Cannot find Django on the current path. Is it installed?')
            django = None

        if django:
            from django.conf import settings
            from django.core import management
            from django import setup

            import sqlite3
            import os

            db_filename = 'generated_db.db'

            conn = sqlite3.connect(db_filename)
            c = conn.cursor()
            for i in u:
                c.execute(i)

            if not settings.configured:
                settings.configure(
                    DEBUG='on',
                    SECRET_KEY='1234',
                    ALLOWED_HOSTS='localhost',
                    DATABASES = {'default' : {'NAME':db_filename,'ENGINE':'django.db.backends.sqlite3'}},
                    )
                django.setup()
            management.call_command('inspectdb', interactive=False)
            os.remove(db_filename)
dataset/ETHPy150Open catherinedevlin/ddl-generator/ddlgenerator/ddlgenerator.py/Table.django_models