Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#16989 closed Bug (invalid)

Problem with DEFAULT_DB_ALIAS in settings

Reported by: sergeybe@… Owned by: nobody
Component: Core (Other) Version: 1.3
Severity: Normal Keywords: DEFAULT_DB_ALIAS settings
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


My has lines:

DEFAULT_DB_ALIAS = 'production'

    'default': {
        'ENGINE': 'django.db.backends.sqlite3', 
        'NAME': 'xxx.sqlite',              
        'USER': '',                      
        'PASSWORD': '',                  
        'HOST': '',                      
        'PORT': '',                      
    'production':  {
        'ENGINE': 'django.db.backends.mysql', 
        'NAME': 'XXX',                      
        'USER': 'XXX',                      
        'PASSWORD': 'XXX',                  
        'HOST': 'localhost',                
        'PORT': '3306',                     

When I run command "python syncdb" and Django creates sqlite database instead of MySQL database. It uses "default" alias instead of "production" alias. But next command works correctly "python syncdb --database=production".

I guess this is bug.

Change History (2)

comment:1 Changed 7 years ago by Russell Keith-Magee

Resolution: invalid
Status: newclosed

I'm not sure what gave you the idea that DEFAULT_DB_ALIAS is a setting, but it isn't. DEFAULT_DB_ALIAS is a constant, defined in the django.db module, that expands to "default".

I'm closing this invalid; however, If you can point to somewhere in the documentation that suggests that DEFAULT_DB_ALIAS is a setting, that might point to some documentation that needs to be corrected -- in which case, please provide details and reopen this ticket as a documentation issue.

comment:2 Changed 5 years ago by anonymous

Thought I'd chime in -- the DEFAULT_DB_ALIAS constant is required when using the python package "south".

Not really a setting, but it IS a required constant when using South and running "syncdb", but clearly it is not a django issue.

Definitely invalid, but if anyone happens to find this know that it's a South thing and I'm pretty sure it's behaving as expected.

Note: See TracTickets for help on using tickets.
Back to Top