0

I have the following 2 databases in my DATABASES dictionary:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'C:/Users/B/Desktop/board.db'
    },
    'game':{
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'C:/Users/B/Desktop/gamelogic.db'
    },
}

I'm having trouble doing inspectdb on the second database 'game'.

I tried to do: python manage.py inspectdb --database 'game' but I'm getting the error django.db.utils.ConnectionDoesNotExist: The connection 'game' doesn't exist even though the database exists. How do I inspectdb a non-default database?

TheEyesHaveIt
  • 980
  • 5
  • 16
  • 33

1 Answers1

3

Use this command:

python manage.py inspectdb --database=game > your_app/models.py
M.Void
  • 2,764
  • 2
  • 29
  • 44