Ticket #460 (closed defect: invalid)

Opened 4 years ago

Last modified 3 years ago

south soes not work with new DATABASES settings

Reported by: anonymous Owned by: andrew
Priority: major Milestone: 0.7.2
Component: commands Version: 0.7
Keywords: Cc:

Description

if the DATABASES setting is used:

DATABASES = {

'default': {

'ENGINE': ,
'NAME':
,
'USER': ,
'PASSWORD':
,
'HOST': ,
'PORT':
,

}

}

instead of the old one:

DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME =
DATABASE_USER =

DATABASE_PASSWORD =
DATABASE_HOST =

DATABASE_PORT =

then south will produce an error on first syncdb and maybe others as well:

AttributeError?: 'module' object has no attribute 'DatabaseOperations?'

Change History

comment:1 Changed 4 years ago by andrew

  • Status changed from new to infoneeded
  • Milestone set to 0.7.2

Are you sure? It works fine with them here - could you paste your exact settings, and make sure you're using 0.7?

comment:2 Changed 4 years ago by andrew

  • Status changed from infoneeded to closed
  • Resolution set to invalid

Closing as invalid, no response.

comment:3 Changed 3 years ago by james@…

I think I just encountered this problem. The traceback below is what happened when I tried to run manage.py syncdb for the first time after adding south to my installed apps. (note the line numbers are wrong because I added the print statement to print the name of the module south was trying to install -- which as you can see is missing the actual database type)

If I add this to my settings.py then things work:

    DATABASE_ENGINE = 'sqlite3'

but south doesn't seem to pick up my normal database settings:

DATABASES = {
    'default': {
        #'ENGINE': 'django.db.backends.sqlite3', # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'ENGINE': 'sqlite3',
        'NAME': os.environ['DB'],     # Or path to database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}

I'm using django 1.2.1 with python 2.6 and south 0.6.

Warning: DEBUG IS ON!
Warning: DEBUG IS ON!
south database module name: south.db.
south database module name: south.db.
Traceback (most recent call last):
  File "./ST/manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.1-py2.6.egg/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.1-py2.6.egg/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.1-py2.6.egg/django/core/management/__init__.py", line 257, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.1-py2.6.egg/django/core/management/__init__.py", line 67, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.1-py2.6.egg/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/usr/lib/pymodules/python2.6/south/management/commands/syncdb.py", line 5, in <module>
    from south import migration
  File "/usr/lib/pymodules/python2.6/south/migration.py", line 17, in <module>
    from south.db import db
  File "/usr/lib/pymodules/python2.6/south/db/__init__.py", line 13, in <module>
    module = __import__(module_name,{},{},[''])
  File "/usr/lib/pymodules/python2.6/south/db/__init__.py", line 18, in <module>
    db = module.DatabaseOperations()
AttributeError: 'module' object has no attribute 'DatabaseOperations'

comment:4 Changed 3 years ago by James <james@…>

  • Status changed from closed to reopened
  • Resolution invalid deleted

comment:5 Changed 3 years ago by andrew

That's because you have "sqlite3" as the database engine, not "django.db.backends.sqlite3" - try changing that and see if it works.

comment:6 Changed 3 years ago by James <james@…>

I had it set as 'django.db.backends.sqlite3' to start with (hence the commented out line), and it didn't work --- I changed it to just 'sqlite3' to see if that helped.

comment:7 follow-up: ↓ 8 Changed 3 years ago by andrew

  • Status changed from reopened to closed
  • Resolution set to invalid

Ah, I see you said you were using 0.6 - 0.6 doesn't support django 1.2, you need to upgrade. Also, next time, please open a new ticket!

comment:8 in reply to: ↑ 7 Changed 3 years ago by James <james@…>

Replying to andrew:

Ah, I see you said you were using 0.6 - 0.6 doesn't support django 1.2, you need to upgrade. Also, next time, please open a new ticket!

Ah, okay, thanks!
Sorry, will do in future.

Note: See TracTickets for help on using tickets.