Question: I want to run [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-inspectdb) against an Oracle database. The user account that I use is a read only user that owns 0 tables. It, however, has access to the schema that contains all the tables. How do I specify a schema when using `inspectdb`?

My command, currently, is: `python manage.py inspectdb --database "oradb" > test_model.py`

This only outputs a file with `from django.db import models`.

Answer: 
The problem is that Django's [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#inspectdb) doesn't support Oracle. From the docs:

> 
> inspectdb works with PostgreSQL, MySQL and SQLite. Foreign-key
>  detection only works in PostgreSQL and with certain types of MySQL
>  tables.
> 
> 
> The --database option may be used to specify the database to
>  introspect.
> 
> 
>
Try to specify the search\_path, by adding an option in your DATABASES variable at settings.py, like that:

```
'OPTIONS': {
       'options': '-c search_path=myschema'
}

```

The full DATABASES variable should be:

```
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'mydatabase',
        'USER': 'postgres',
        'PASSWORD': 'mypassword',
        'HOST': 'localhost',
        'PORT': '5432',
        'OPTIONS': {
            'options': '-c search_path=myschema'
        }
    }
}

```

After that `python migrate inspectdb` should work on your schema