Reputation: 3
(mydjango) C:\StockMarketResearch\Else\StockAnalysisApp>python manage.py dbshell
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:\mydjango\lib\site-packages\django\core\management\__init__.py", line 338, in execute_from_command_line
utility.execute()
File "C:\mydjango\lib\site-packages\django\core\management\__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\mydjango\lib\site-packages\django\core\management\base.py", line 390, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\mydjango\lib\site-packages\django\core\management\base.py", line 441, in execute
output = self.handle(*args, **options)
File "C:\mydjango\lib\site-packages\django\core\management\commands\dbshell.py", line 19, in handle
connection.client.runshell()
File "C:\mydjango\lib\site-packages\django\db\backends\dummy\base.py", line 21, in complain
raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details
Database setting:
DATABASES = {
'default':{
},
'stock':{
'NAME': 'STOCK',
'ENGINE': 'sqlserver_ado',
'HOST': 'EC2AMAZ-L7EBVJV\SQLEXPRESS1',
'USER': 'sa',
'PASSWORD': 'XXX',
'OPTIONS': {
'provider': 'SQLOLEDB',
'use_legacy_date_fields': True,
#'MARS_Connection': True
}
}
this error occurs only when I try python manage.py dbshell/migrate/syncdb but I am able to execute simple database queries like select * from xyz (without any error or warning) but not able to run queries like insert into abc(x, c) select x,c from pqr this gives me error trying to fetch from a closed connection or empty set And again I am able to execute nested queries without error
Upvotes: 0
Views: 4660
Reputation: 43300
Your databases set doesn't contain a complete definition for the default
dict, its just an empty dict.
Either copy your definition for stock
into default (preferably set to a variable that is then set to both definitions) or define it
Upvotes: 2