Ticket #618: database_port.patch
File database_port.patch, 3.1 KB (added by , 19 years ago) |
---|
-
django/conf/project_template/settings/main.py
15 15 DATABASE_USER = '' # Not used with sqlite3. 16 16 DATABASE_PASSWORD = '' # Not used with sqlite3. 17 17 DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. 18 DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. 18 19 19 20 SITE_ID = 1 20 21 -
django/conf/global_settings.py
50 50 DATABASE_USER = '' 51 51 DATABASE_PASSWORD = '' 52 52 DATABASE_HOST = '' # Set to empty string for localhost 53 DATABASE_PORT = '' # Set to empty string for default 53 54 54 55 # Host for sending e-mail. 55 56 EMAIL_HOST = 'localhost' -
django/core/db/backends/postgresql.py
15 15 self.queries = [] 16 16 17 17 def cursor(self): 18 from django.conf.settings import DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_P ASSWORD, DEBUG, TIME_ZONE18 from django.conf.settings import DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_PORT, DATABASE_PASSWORD, DEBUG, TIME_ZONE 19 19 if self.connection is None: 20 20 if DATABASE_NAME == '': 21 21 from django.core.exceptions import ImproperlyConfigured … … 27 27 conn_string += " password=%s" % DATABASE_PASSWORD 28 28 if DATABASE_HOST: 29 29 conn_string += " host=%s" % DATABASE_HOST 30 if DATABASE_PORT: 31 conn_string += " port=%s" % DATABASE_PORT 30 32 self.connection = Database.connect(conn_string) 31 33 self.connection.set_isolation_level(1) # make transactions transparent to all cursors 32 34 cursor = self.connection.cursor() -
django/core/db/backends/mysql.py
53 53 self.queries = [] 54 54 55 55 def cursor(self): 56 from django.conf.settings import DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_P ASSWORD, DEBUG56 from django.conf.settings import DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_PORT, DATABASE_PASSWORD, DEBUG 57 57 if self.connection is None: 58 58 self.connection = Database.connect(user=DATABASE_USER, db=DATABASE_NAME, 59 passwd=DATABASE_PASSWORD, host=DATABASE_HOST, conv=django_conversions)59 passwd=DATABASE_PASSWORD, host=DATABASE_HOST, port=DATABASE_PORT, conv=django_conversions) 60 60 if DEBUG: 61 61 return base.CursorDebugWrapper(MysqlDebugWrapper(self.connection.cursor()), self) 62 62 return self.connection.cursor()