{{{
File
"/Users/brandon.konkle/code/django/django/core/management/commands/migrate.py",
line 70, in handle
connection = connections[db]
File "/Users/brandon.konkle/code/django/django/db/utils.py", line 234,
in __getitem__
if hasattr(self._connections, alias):
TypeError: hasattr(): attribute name must be string
}}}
This is because the newly-introduced argparse resolves `db =
options.get('database')` to `None`, and Python 3 raises a TypeError when
None is used as the first argument to `hasattr`.
--
Ticket URL: <https://code.djangoproject.com/ticket/24579>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Hmm, argparse actually shouldn't be resolving this to `None`, because the
--database option has a default set: `default=DEFAULT_DB_ALIAS`, which is
'default'.
--
Ticket URL: <https://code.djangoproject.com/ticket/24579#comment:1>
Comment (by bkonkle):
For some reason, the the migrate command is showing up as having an
option_list, so it's not calling the add_arguments() method and setting up
the default.
--
Ticket URL: <https://code.djangoproject.com/ticket/24579#comment:2>
* status: new => closed
* resolution: => wontfix
Comment:
Aha! This is a side-effect of `django-configurations` adding the
--configuration option to the base management command. I'll submit a pull
request there.
--
Ticket URL: <https://code.djangoproject.com/ticket/24579#comment:3>