
# Establish the common DatabaseOperations instance, which we call 'db'.
# This code somewhat lifted from django evolution
from django.conf import settings
import sys
module_name = ['south.db', settings.DATABASE_ENGINE]
try:
    module = __import__('.'.join(module_name),{},{},[''])
except ImportError:
    sys.stderr.write("There is no South database module for the engine '%s'. Please either choose a supported one, or remove South from INSTALLED_APPS.\n" % settings.DATABASE_ENGINE)
    sys.exit(1)
db = module.DatabaseOperations()
@@ -164,22 +164,139 @@
 sys%0A
-module_name = 
+if hasattr(settings, %22SOUTH_DATABASE_ADAPTER%22):%0A    module_name = settings.SOUTH_DATABASE_ADAPTER%0Aelse:%0A    module_name = '.'.join(
 %5B'so
@@ -329,16 +329,18 @@
 _ENGINE%5D
+)%0A
 %0Atry:%0A  
@@ -361,25 +361,16 @@
 mport__(
-'.'.join(
 module_n
@@ -372,17 +372,16 @@
 ule_name
-)
 ,%7B%7D,%7B%7D,%5B
@@ -480,16 +480,32 @@
 ine '%25s'
+ (tried with %25s)
 . Please
@@ -535,16 +535,62 @@
 ted one,
+ or check for SOUTH_DATABASE_ADAPTER settings,
  or remo
@@ -626,10 +626,33 @@
 %5Cn%22 
+%0A                     
 %25 
+(
 sett
@@ -671,16 +671,30 @@
 E_ENGINE
+, module_name)
 )%0A    sy
@@ -735,8 +735,9 @@
 ations()
+%0A

Fix #163: Allow database adapters for South that aren't under "south.db.dbname".