(wheezy)root@aquitard:~# /usr/bin/django-admin dumpdata --settings=karaage.tests.settings
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/django/bin/django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 261, in fetch_command
commands = get_commands()
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 107, in get_commands
apps = settings.INSTALLED_APPS
File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 54, in __getattr__
self._setup(name)
File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 49, in _setup
self._wrapped = Settings(settings_module)
File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 132, in __init__
% (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'karaage.tests.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named tests.settings
The problem is that the django-admin wrapper chose the python3 version, but karaage.tests.settings is only available in Python2, even though I have python3-django installed.
However, anything I do here will mean making changes from upstream.
I guess I could also try to parse the --settings or DJANGO_SETTINGS_MODULE, try to determine automatically if the Python3 version exists. However I think this could get very messy very quickly and probably won't work in all cases.
Can change it for new packages, not for old packages though. I don't see any good solution for this though.