=== django/conf/project_template/settings.py
==================================================================
|
|
|
11 | 11 | |
12 | 12 | DATABASE_ENGINE = '' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. |
13 | 13 | DATABASE_NAME = '' # Or path to database file if using sqlite3. |
| 14 | DATABASE_SCHEMAS = '' # Only used with postgresq to support multiple schemas |
14 | 15 | DATABASE_USER = '' # Not used with sqlite3. |
15 | 16 | DATABASE_PASSWORD = '' # Not used with sqlite3. |
16 | 17 | DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. |
=== django/db/backends/postgresql/base.py
==================================================================
|
|
|
44 | 44 | self.connection.set_isolation_level(1) # make transactions transparent to all cursors |
45 | 45 | cursor = self.connection.cursor() |
46 | 46 | cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE]) |
| 47 | if settings.DATABASE_SCHEMAS: |
| 48 | cursor.execute("SET search_path TO %s;" % settings.DATABASE_SCHEMAS) |
47 | 49 | if settings.DEBUG: |
48 | 50 | return util.CursorDebugWrapper(cursor, self) |
49 | 51 | return cursor |