X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fprojects%2Fdorestad-bookings.git;a=blobdiff_plain;f=southsettings.py;fp=southsettings.py;h=63ff314cf6bb120314c2972f4e6a82c189b52569;hp=0000000000000000000000000000000000000000;hb=d09fb5a3490ef7cf9eb957bd3ca7f87386203f02;hpb=26904a04c7ae9b2806dc3aa8fbfa33dcca2c5c7a diff --git a/southsettings.py b/southsettings.py new file mode 100644 index 0000000..63ff314 --- /dev/null +++ b/southsettings.py @@ -0,0 +1,17 @@ +# Database settings for when doing a database migration using south, +# which requires more privileges. + +import sys +if 'manage.py' in sys.argv[0] and sys.argv[1] == 'migrate': + import south + + try: + # We cache the prompted values in the south module, since the + # settings module gets loaded multiple times... + DATABASE_USER = south.cached_db_user + DATABASE_PASSWORD = south.cached_db_pw + except AttributeError: + DATABASE_USER = raw_input("Privileged database user: ") + DATABASE_PASSWORD = raw_input("Database password for %s: " % DATABASE_USER) + south.cached_db_user = DATABASE_USER + south.cached_db_pw = DATABASE_PASSWORD