Django boto3 error during collectstatic command - django

I'm trying to run a gitlab project on a local machine. I have a problem at the start of the command
manage.py collectstatic
error
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/y700/Env/healthline/lib/python3.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/home/y700/Env/healthline/lib/python3.7/site-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/y700/Env/healthline/lib/python3.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/y700/Env/healthline/lib/python3.7/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/home/y700/Env/healthline/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 199, in handle
collected = self.collect()
File "/home/y700/Env/healthline/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 124, in collect
handler(path, prefixed_path, storage)
File "/home/y700/Env/healthline/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 354, in copy_file
if not self.delete_file(path, prefixed_path, source_storage):
File "/home/y700/Env/healthline/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 260, in delete_file
if self.storage.exists(prefixed_path):
File "/home/y700/Env/healthline/lib/python3.7/site-packages/storages/backends/s3boto3.py", line 532, in exists
self.connection.meta.client.head_object(Bucket=self.bucket_name, Key=name)
File "/home/y700/Env/healthline/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/home/y700/Env/healthline/lib/python3.7/site-packages/botocore/client.py", line 634, in _make_api_call
api_params, operation_model, context=request_context)
File "/home/y700/Env/healthline/lib/python3.7/site-packages/botocore/client.py", line 680, in _convert_to_request_dict
api_params, operation_model, context)
File "/home/y700/Env/healthline/lib/python3.7/site-packages/botocore/client.py", line 712, in _emit_api_params
params=api_params, model=operation_model, context=context)
File "/home/y700/Env/healthline/lib/python3.7/site-packages/botocore/hooks.py", line 356, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "/home/y700/Env/healthline/lib/python3.7/site-packages/botocore/hooks.py", line 228, in emit
return self._emit(event_name, kwargs)
File "/home/y700/Env/healthline/lib/python3.7/site-packages/botocore/hooks.py", line 211, in _emit
response = handler(**kwargs)
File "/home/y700/Env/healthline/lib/python3.7/site-packages/botocore/handlers.py", line 219, in validate_bucket_name
if VALID_BUCKET.search(bucket) is None:
TypeError: expected string or bytes-like object
I tried to update the boto3 version, but it didn't help.
settings.py (part)
....
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'app', 'static'),
]
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
....
else I have settings for AWS server
AWS_LOCATION = 'static'
DEFAULT_FILE_STORAGE = 'app.storage_backends.PrivateMediaStorage'
AWS_PUBLIC_STATIC_LOCATION = 'static/'

Related

ssl error with copying file in s3 server?

I tried to collect static files on the S3 Server for my Django project with the command :
python manage.py collectstatic
But It failed because of SSLError :
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\httpsession.py", line 414, in send
chunked=self._chunked(request.headers),
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\urllib3\connectionpool.py", line 756, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\urllib3\util\retry.py", line 507, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\urllib3\packages\six.py", line 769, in reraise
raise value.with_traceback(tb)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\urllib3\connectionpool.py", line 706, in urlopen
chunked=chunked,
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\urllib3\connection.py", line 421, in connect
tls_in_tls=tls_in_tls,
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\urllib3\util\ssl_.py", line 450, in ssl_wrap_socket
sock, context, tls_in_tls, server_hostname=server_hostname
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\urllib3\util\ssl_.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Users\Anthony\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 423, in wrap_socket
session=session
File "C:\Users\Anthony\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 870, in _create
self.do_handshake()
File "C:\Users\Anthony\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 1139, in do_handshake
self._sslobj.do_handshake()
urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\django\core\management\__init__.py", line 419, in execute_from_command_line
utility.execute()
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\django\core\management\__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\django\core\management\base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\django\core\management\base.py", line 398, in execute
output = self.handle(*args, **options)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 187, in handle
collected = self.collect()
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 114, in collect
handler(path, prefixed_path, storage)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 338, in copy_file
if not self.delete_file(path, prefixed_path, source_storage):
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 248, in delete_file
if self.storage.exists(prefixed_path):
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\storages\backends\s3boto3.py", line 469, in exists
self.connection.meta.client.head_object(Bucket=self.bucket_name, Key=name)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\client.py", line 395, in _api_call
return self._make_api_call(operation_name, kwargs)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\client.py", line 712, in _make_api_call
operation_model, request_dict, request_context)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\client.py", line 731, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\endpoint.py", line 107, in make_request
return self._send_request(request_dict, operation_model)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\endpoint.py", line 184, in _send_request
success_response, exception):
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\endpoint.py", line 308, in _needs_retry
caught_exception=caught_exception, request_dict=request_dict)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\hooks.py", line 357, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\hooks.py", line 228, in emit
return self._emit(event_name, kwargs)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\hooks.py", line 211, in _emit
response = handler(**kwargs)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\retryhandler.py", line 192, in __call__
if self._checker(**checker_kwargs):
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\retryhandler.py", line 266, in __call__
caught_exception)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\retryhandler.py", line 292, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\retryhandler.py", line 332, in __call__
caught_exception)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\retryhandler.py", line 232, in __call__
attempt_number, caught_exception)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\retryhandler.py", line 374, in _check_caught_exception
raise caught_exception
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\endpoint.py", line 249, in _do_get_response
http_response = self._send(request)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\endpoint.py", line 321, in _send
return self.http_session.send(request)
File "C:\Users\Anthony\Documents\website_django\venv\lib\site-packages\botocore\httpsession.py", line 432, in send
raise SSLError(endpoint_url=request.url, error=e)
botocore.exceptions.SSLError: SSL validation failed for https://kol-mevasser-content.s3.eu-west-3.amazonaws.com/static/favicon.ico [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)
So I tried to install certifi with pip install certifi but it didn't work.
How can I collect my static files into S3 Server with resolving this SSL Error ?
Here is in my settings.py file :
# (I voluntary put SECRET)
AWS_ACCESS_KEY_ID = "SECRET"
AWS_SECRET_ACCESS_KEY = "SECRET"
AWS_STORAGE_BUCKET_NAME = "SECRET"
AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME
AWS_S3_OBJECT_PARAMETERS = {
'CacheControl': 'max-age=86400',
}
AWS_LOCATION = 'static'
AWS_S3_REGION_NAME = 'eu-west-3'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]
STATIC_URL = 'https://%s/%s/' % (AWS_S3_CUSTOM_DOMAIN, AWS_LOCATION)
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
Seems AWS_S3_VERIFY=False setting is what you desire
https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html

manage.py collectstatic not working in macOS 10.13.1

I'm having issues while running collectstatic in macOS. The error is OSError: [Errno 45] Operation not supported: '/home/juan'
./manage.py collectstatic
Copying '/Users/juan/Documents/manu/dev/sw/webwatcher/venv/lib/python3.6/site-packages/django/contrib/admin/static/admin/css/widgets.css'
Traceback (most recent call last):
File "./manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/Users/juan/Documents/manu/dev/sw/webwatcher/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/Users/juan/Documents/manu/dev/sw/webwatcher/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/juan/Documents/manu/dev/sw/webwatcher/venv/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/juan/Documents/manu/dev/sw/webwatcher/venv/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
output = self.handle(*args, **options)
File "/Users/juan/Documents/manu/dev/sw/webwatcher/venv/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 189, in handle
collected = self.collect()
File "/Users/juan/Documents/manu/dev/sw/webwatcher/venv/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect
handler(path, prefixed_path, storage)
File "/Users/juan/Documents/manu/dev/sw/webwatcher/venv/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 354, in copy_file
self.storage.save(prefixed_path, source_file)
File "/Users/juan/Documents/manu/dev/sw/webwatcher/venv/lib/python3.6/site-packages/django/core/files/storage.py", line 49, in save
return self._save(name, content)
File "/Users/juan/Documents/manu/dev/sw/webwatcher/venv/lib/python3.6/site-packages/django/core/files/storage.py", line 236, in _save
os.makedirs(directory)
File "/Users/juan/Documents/manu/dev/sw/webwatcher/venv/bin/../lib/python3.6/os.py", line 210, in makedirs
makedirs(head, mode, exist_ok)
File "/Users/juan/Documents/manu/dev/sw/webwatcher/venv/bin/../lib/python3.6/os.py", line 210, in makedirs
makedirs(head, mode, exist_ok)
File "/Users/juan/Documents/manu/dev/sw/webwatcher/venv/bin/../lib/python3.6/os.py", line 210, in makedirs
makedirs(head, mode, exist_ok)
File "/Users/juan/Documents/manu/dev/sw/webwatcher/venv/bin/../lib/python3.6/os.py", line 220, in makedirs
mkdir(name, mode)
OSError: [Errno 45] Operation not supported: '/home/juan'
----------
The same command in the same project is running fine in ubuntu
Concerning the people who have this problem. You need to set your static, media root directories and URLs properly. Here is an example:
settings.py:
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'
urls.py:
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL,document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)

Django Tests with POSTGIS Database: no attribute geo_db_type

I am trying to run django's test suite for my application with two databases: one using postgres and the other using POSTGIS. Here is my DATABASES configuration:
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
...},
'POSTGIS': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
...}
When I run python manage.py test app I am prompted to delete an old test database, and when I say yes I get the following error:
Destroying old test database for alias 'default'...
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/core/management/commands/test.py", line 30, in run_from_argv
super(Command, self).run_from_argv(argv)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/core/management/commands/test.py", line 74, in execute
super(Command, self).execute(*args, **options)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/core/management/commands/test.py", line 90, in handle
failures = test_runner.run_tests(test_labels)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/test/runner.py", line 532, in run_tests
old_config = self.setup_databases()
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/test/runner.py", line 482, in setup_databases
self.parallel, **kwargs
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/test/runner.py", line 726, in setup_databases
serialize=connection.settings_dict.get("TEST", {}).get("SERIALIZE", True),
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/db/backends/base/creation.py", line 70, in create_test_db
run_syncdb=True,
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/core/management/__init__.py", line 119, in call_command
return command.execute(*args, **defaults)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 172, in handle
self.sync_apps(connection, executor.loader.unmigrated_apps)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 285, in sync_apps
editor.create_model(model)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 235, in create_model
definition, extra_params = self.column_sql(model, field)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 134, in column_sql
db_params = field.db_parameters(connection=self.connection)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 636, in db_parameters
type_string = self.db_type(connection)
File "/home/ubuntu/yes/lib/python2.7/site-packages/django/contrib/gis/db/models/fields.py", line 120, in db_type
return connection.ops.geo_db_type(self)
AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'
Which version of Django are you using?
When you made the database changes, prior to anything else, did you use the appropriate command to update the databases and relationships to them, i.e., syncdb or migrate?
Answering those two questions will help diagnose the problem. Thanks!

python manage.py runserver 127.0.0.1:80

Traceback (most recent call last):
File "manage.py", line 28, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 231, in execute
self.validate()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 266, in validate
num_errors = get_validation_errors(s, app)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py", line 30, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 158, in get_app_errors
self._populate()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 64, in _populate
self.load_app(app_name, True)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 88, in load_app
models = import_module('.models', app_name)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/cartridge/shop/models.py", line 411, in <module>
class Order(models.Model):
File "/usr/local/lib/python2.7/dist-packages/cartridge/shop/models.py", line 422, in Order
billing_detail_country = ForeignKey(Category, verbose_name = _("State/Region"), related_name='order', limit_choices_to={ "parent":Category.objects.get(slug='regions') }, blank=True, null=True)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 131, in get
return self.get_query_set().get(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 361, in get
num = len(clone)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 85, in __len__
self._result_cache = list(self.iterator())
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 291, in iterator
for row in compiler.results_iter():
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 763, in results_iter
for rows in self.execute_sql(MULTI):
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 40, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py", line 344, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.DatabaseError: no such table: shop_category
Hello.
python manage.py runserver 127.0.0.1:80 not running on server.
In MySQL table shop_category present. In settings.py name DB, login and password configured.
syncdb not solved my problem.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',

How to run South migrations for two (or multiple) Django test databases?

In my apps settings.py file (then made available in django.conf.settings) I have specified:
DATABASES = {'default': dj_database_url.parse(os.environ['DATABASE']),
'secondary': dj_database_url.parse(os.environ['SECONDARY_DATABASE'])}
SOUTH_TESTS_MIGRATE = True
But running my tests using ./manage.py test app_name runs the migrations for the default database and creates some of the tables for the secondary database before failing with:
Creating test database for alias 'secondary' ('test_secondary')...
Syncing...
Creating tables ...
Creating table auth_permission
...
Creating table django_admin_log
Installing custom SQL ...
Installing indexes ...
Migrating...
Traceback (most recent call last):
File "./manage.py", line 18, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/usr/local/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 381, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/venv/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 49, in run_from_argv
super(Command, self).run_from_argv(argv)
File "/usr/local/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/usr/local/venv/local/lib/python2.7/site-packages/django/test/simple.py", line 381, in run_tests
old_config = self.setup_databases()
File "/usr/local/venv/local/lib/python2.7/site-packages/django/test/simple.py", line 317, in setup_databases
self.verbosity, autoclobber=not self.interactive)
File "/usr/local/venv/local/lib/python2.7/site-packages/south/hacks/django_1_0.py", line 100, in wrapper
f(*args, **kwargs)
File "/usr/local/venv/local/lib/python2.7/site-packages/django/db/backends/creation.py", line 271, in create_test_db
load_initial_data=False)
File "/usr/local/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 149, in call_command
return klass.execute(*args, **defaults)
File "/usr/local/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/usr/local/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(**options)
File "/usr/local/venv/local/lib/python2.7/site-packages/south/management/commands/syncdb.py", line 99, in handle_noargs
management.call_command('migrate', **options)
File "/usr/local/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 149, in call_command
return klass.execute(*args, **defaults)
File "/usr/local/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/usr/local/venv/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 108, in handle
ignore_ghosts = ignore_ghosts,
File "/usr/local/venv/local/lib/python2.7/site-packages/south/migration/__init__.py", line 171, in migrate_app
south.db.db = south.db.dbs[database]
KeyError: 'secondary'