﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13200	syncdb does not use SESSION_DB_ALIAS for creating session table	rokclimb15	nobody	"When trying to store sessions in another database using SESSION_DB_ALIAS, syncdb attempts to create the table under the default db alias.  It also attempts to connect with the user credentials from the default alias.  This is an issue if that user doesn't have create permissions on that database.  It seems like it should use the correct alias and user settings from that alias.  If you use --database argument with syncdb, it syncs all models to that database, so it doesn't really apply.

I suppose this isn't a tremendous problem since the output from a sql management command can be piped into the database, but it could be confusing because syncdb by default puts the table in the default database and then session will get an error when it tries to access it in the other db (and it doesn't exist).

Example:
{{{
#!python
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'db1',
        'USER': 'dbuser1',                      # Not used with sqlite3.
        'PASSWORD': 'password1',                  # 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.
    },
    'session': {
        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'session',                      # Or path to database file if using sqlite3.
        'USER': 'dbuser2',                      # Not used with sqlite3.
        'PASSWORD': 'password2',                  # 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.
    }
}

SESSION_DB_ALIAS = 'session'
}}}"		closed	contrib.sessions	dev		fixed	SESSION_DB_ALIAS		Accepted	0	0	0	0	0	0
