django psycopg2 and postgresql insertion error - django

I'm having trouble adding any data to my database. It lets me modify entries in tables, but any action that will create a new row or new column in a database is mysteriously failing. Here is the stack trace:
Traceback (most recent call last):
File "manage.py", line 25, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/usr/local/python2.7/lib/python2.7/site-packages/South-0.7.4-py2.7.egg/south/management/commands/migrate.py", line 107, in handle
ignore_ghosts = ignore_ghosts,
File "/usr/local/python2.7/lib/python2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/__init__.py", line 219, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/usr/local/python2.7/lib/python2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 235, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/usr/local/python2.7/lib/python2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 310, in migrate_many
result = self.migrate(migration, database)
File "/usr/local/python2.7/lib/python2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 134, in migrate
self.done_migrate(migration, database)
File "/usr/local/python2.7/lib/python2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 113, in done_migrate
self.record(migration, database)
File "/usr/local/python2.7/lib/python2.7/site-packages/South-0.7.4-py2.7.egg/south/migration/migrators.py", line 280, in record
record.save()
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/db/models/base.py", line 463, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/db/models/base.py", line 551, in save_base
result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/db/models/manager.py", line 203, in _insert
return insert_query(self.model, objs, fields, **kwargs)
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/db/models/query.py", line 1576, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/db/models/sql/compiler.py", line 910, in execute_sql
cursor.execute(sql, params)
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/db/backends/util.py", line 40, in execute
return self.cursor.execute(sql, params)
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: syntax error at or near "RETURNING" at character 171
It was working fine until I migrated databases to another server. Now I'm having all sorts of trouble and I'm unsure what to do. Also, this seems to happen for South as well if trying to add a field to the database. Curiously, modifying existing objects / columns in the database succeeds without failure. I'm really unsure what to do and would love any assistance.

8.1 doesn't support the RETURNING clause. So upgrade your database version to the current stable release.

8.1 doesn't support RETURNING ids of inserted objects so you need to disable it.
from django.db import connection
##just before insert statement
connection.features.can_return_id_from_insert = False
###some insert statement

Related

unable to create superuser in python Django

I have read questions in Stackoverflow and googled, but no luck.
I am trying to create a superuser in pycharm(manage.py createsuperuser
) but got below error:
"cassandra.protocol.SyntaxException: "
Not checking migrations as it is not possible to access/create the django_migrations table.
Traceback (most recent call last):
File "C:\Users\skum\PQP_Bridge\manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 363, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python27\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 63, in execute
return super(Command, self).execute(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 330, in execute
output = self.handle(*args, **options)
File "C:\Python27\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 96, in handle
default_username = get_default_username()
File "C:\Python27\lib\site-packages\django\contrib\auth\management\__init__.py", line 148, in get_default_username
auth_app.User._default_manager.get(username=default_username)
File "C:\Python27\lib\site-packages\django\db\models\manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\db\models\query.py", line 374, in get
num = len(clone)
File "C:\Python27\lib\site-packages\django\db\models\query.py", line 232, in __len__
self._fetch_all()
File "C:\Python27\lib\site-packages\django\db\models\query.py", line 1118, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "C:\Python27\lib\site-packages\django\db\models\query.py", line 53, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", line 894, in execute_sql
raise original_exception
cassandra.protocol.SyntaxException: <Error from server: code=2000 [Syntax error in CQL query] message="line 1:260 no viable alternative at input '.' (
...auth_user.date_joined FROM auth_user WHERE [auth_user]....)">
what am I doing wrong?
I am using Cassandra 3.0, Python Django 1.11.4, and pycharm.
We can not use: python manage.py createsuperuser using Cassandra It do not work with default django model. You need to use external library for the same. user module does not work with Cassandra by default
Please read document on data-stax or below given link. https://pypi.python.org/pypi/django-cassandra-engine/

django.db.utils.ProgrammingError: Could not load : column "" of relation "" does not exist

I just added a field to my model and added the values of the field to my fixtures. However, I am getting this error:
django.db.utils.ProgrammingError: Problem installing fixture 'app/fixtures/tool.json': Could not load "": column "new_field" of relation "app_model" does not exist
which is the same error I got before even putting values in the fixture. What is it that I'm forgetting?
Here's the Traceback:
Traceback (most recent call last):
File "./manage.py", line 12, in <module>
execute_from_command_line(sys.argv)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/webapps/my_app/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 64, in handle
self.loaddata(fixture_labels)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 104, in loaddata
self.load_label(fixture_label)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 167, in load_label
obj.save(using=self.using)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/core/serializers/base.py", line 201, in save
models.Model.save_base(self.object, using=using, raw=True, **kwargs)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/db/models/base.py", line 824, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/db/models/base.py", line 889, in _save_table
forced_update)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/db/models/base.py", line 939, in _do_update
return filtered._update(values) > 0
File "/webapps/my_app/local/lib/python2.7/site-packages/django/db/models/query.py", line 654, in _update
return query.get_compiler(self.db).execute_sql(CURSOR)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 1148, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 835, in execute_sql
cursor.execute(sql, params)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/webapps/my_app/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: Problem installing fixture '/webapps/my_app/tools/fixtures/tools.json': Could not load myapp.model(pk=3): column "new_field" of relation "myapp_model" does not exist
LINE 1: ..._LOCK,android.permission.RECEIVE_BOOT_COMPLETED', "new_field"...
So the way I solved this issue does not make so much sense. I did it by manually adding the column to the table. Then I ran migrate. Since I had the column the second time I was migrating, the error changed to column already exists. So then I deleted the column and it created the column automatically. I am not sure why it did not work in the first place, but if you have this problem, tweak around with the database.

Data truncate error when using manage.py migrate on fresh django installation

I have spent hours trying to get a vagrant django development environment running on my Windows 7 machine.
So far I have:
Used vagrant to create an ubuntu vm
Installed python 3.4.3
Installed mariadb 5.5
Installed django 1.9
Installed mysql-connector-python 2.1.3
Created a new DB in mysql
On a fresh django install, when I try to run python manage.py migrate, I get the following error:
Operations to perform:
Apply all migrations: sessions, auth, contenttypes, admin
Running migrations:
Rendering model states... DONE
Applying contenttypes.0001_initial...Traceback (most recent call last):
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/mysql/connector/django/base.py", line 177, in _execute_wrapper
return method(query, args)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/mysql/connector/cursor.py", line 515, in execute
self._handle_result(self._connection.cmd_query(stmt))
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/mysql/connector/cursor.py", line 434, in _handle_result
self._handle_noresultset(result)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/mysql/connector/cursor.py", line 404, in _handle_noresultset
self._warnings[0][1], self._warnings[0][2])
mysql.connector.errors.DatabaseError: 1265: Data truncated for column 'applied' at row 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
utility.execute()
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/core/management/__init__.py", line 342, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/core/management/commands/migrate.py", line 200, in handle
executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/migrations/executor.py", line 92, in migrate
self._migrate_all_forwards(plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/migrations/executor.py", line 121, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/migrations/executor.py", line 204, in apply_migration
self.recorder.record_applied(migration.app_label, migration.name)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/migrations/recorder.py", line 73, in record_applied
self.migration_qs.create(app=app, name=name)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/models/query.py", line 401, in create
obj.save(force_insert=True, using=self.db)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/models/base.py", line 700, in save
force_update=force_update, update_fields=update_fields)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/models/base.py", line 728, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/models/base.py", line 812, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/models/base.py", line 851, in _do_insert
using=using, raw=raw)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/models/manager.py", line 122, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/models/query.py", line 1039, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/models/sql/compiler.py", line 1064, in execute_sql
cursor.execute(sql, params)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/mysql/connector/django/base.py", line 227, in execute
return self._execute_wrapper(self.cursor.execute, query, new_args)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/mysql/connector/django/base.py", line 195, in _execute_wrapper
utils.DatabaseError(err.msg), sys.exc_info()[2])
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/mysql/connector/django/base.py", line 177, in _execute_wrapper
return method(query, args)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/mysql/connector/cursor.py", line 515, in execute
self._handle_result(self._connection.cmd_query(stmt))
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/mysql/connector/cursor.py", line 434, in _handle_result
self._handle_noresultset(result)
File "/home/vagrant/djangoenv/lib/python3.4/site-packages/mysql/connector/cursor.py", line 404, in _handle_noresultset
self._warnings[0][1], self._warnings[0][2])
django.db.utils.DatabaseError: Data truncated for column 'applied' at row 1
I couldn't find anything that had that exact error. Anyone have any ideas?
It turns out the issue isn't how the table or column is defined, so just looking at the table or column definitions isn't going to do you any good*.
In your [project_name]/settings.py file make sure that under ...
DATABASES = { ...
... the ENGINE attribute is set to django.db.backends.mysql as opposed to mysql.connector.django.
*Although, you should make sure that the column type for applied is DATETIME(6), which shouldn't be a problem since that's the default value Django gives it, so unless you somehow changed it, you should be fine.
The table is django_migrations in case you are wanting to look up the data type.
If you store 12345678901234567890 into an INT, it will be truncated.
If you store 'asdfasdfasdf' into VARCHAR(5), it will be truncated.
Look at your table definition and your data. You can figure this out.

moving django site to another server

I want to move my django site to another machine.
(I want to start with empty DB)
I thought i'll be done with the following steps.
copy all files
setup all tools(django,python,..etc)
run syncdb
When I run manage.py syncdb, it complains some table(such as django_content_type) doesn't exist.
I looked at the DB, indeed there are no tables in the DB.
I tried recreate project(startproject) or recreate app(startapp).
(But they fail because the project or app name is already taken.)
What should I do?
The reason I can think of is mysql being upgraded to 5.5.27 (default to innodb)
$ python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/core/management/base.py", line 231, in execute
self.validate()
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/core/management/base.py", line 266, in validate
num_errors = get_validation_errors(s, app)
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/core/management/validation.py", line 30, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/db/models/loading.py", line 158, in get_app_errors
self._populate()
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/db/models/loading.py", line 64, in _populate
self.load_app(app_name, True)
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/db/models/loading.py", line 88, in load_app
models = import_module('.models', app_name)
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/ubuntu/Documents/aLittleArtist/django/gallery/models.py", line 152, in <module>
ALBUM_IMAGE_TYPE = ContentType.objects.get(app_label="gallery", model="AlbumImage")
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/db/models/manager.py", line 131, in get
return self.get_query_set().get(*args, **kwargs)
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/db/models/query.py", line 361, in get
num = len(clone)
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/db/models/query.py", line 85, in __len__
self._result_cache = list(self.iterator())
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/db/models/query.py", line 291, in iterator
for row in compiler.results_iter():
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter
for rows in self.execute_sql(MULTI):
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
cursor.execute(sql, params)
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/db/backends/util.py", line 40, in execute
return self.cursor.execute(sql, params)
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 114, in execute
return self.cursor.execute(query, args)
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 174, in execute
self.errorhandler(self, exc, value)
File "/home/ubuntu/virtualenvs/aLittleArtist/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
django.db.utils.DatabaseError: (1146, "Table 'gallery_db.django_content_type' doesn't exist")
ALBUM_IMAGE_TYPE = ContentType.objects.get(app_label="gallery", model="AlbumImage")
This line was the culprit.
seems like the above line attempts to do DB query before any DB table is created.
I removed the line and relevant code and let syncdb run. and did migrate with south.

Django unit tests spews database error - cannot commit transaction - SQL statements in progress

I'm using unittest2 together with manage.py test, and before it even seems to run any tests, it spews a horrid database error, as below. I'm in my development environment (actually on a dreamhost server for a variety of reasons), using sqlite as my database.
Even when I copy my app out of where it is for production (and edit settings.py accordingly), I still get the same error (even though it should no longer be addressing the same database file as the dev environment).
Update: Even moving all instances of my database files to a different filename still leaves me with the same error. This leads me to believe that the test environment is somehow looking at a bogus database, or something very odd is happening.
[graffias]$ python manage.py test
Creating test database for alias 'default'...
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_manager(settings)
File "/home/marcintustin/django/Django-1.3/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/marcintustin/django/Django-1.3/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/marcintustin/django/Django-1.3/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/marcintustin/django/Django-1.3/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/home/marcintustin/django/South-0.7.3-py2.5.egg/south/management/commands/test.py", line 8, in handle
super(Command, self).handle(*args, **kwargs)
File "/home/marcintustin/django/Django-1.3/django/core/management/commands/test.py", line 37, in handle
failures = test_runner.run_tests(test_labels)
File "/home/marcintustin/django/Django-1.3/django/test/simple.py", line 359, in run_tests
old_config = self.setup_databases()
File "/home/marcintustin/django/Django-1.3/django/test/simple.py", line 296, in setup_databases
test_db_name = connection.creation.create_test_db(self.verbosity, autoclobber=not self.interactive)
File "/home/marcintustin/django/Django-1.3/django/db/backends/creation.py", line 366, in create_test_db
load_initial_data=False)
File "/home/marcintustin/django/Django-1.3/django/core/management/__init__.py", line 166, in call_command
return klass.execute(*args, **defaults)
File "/home/marcintustin/django/Django-1.3/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/home/marcintustin/django/Django-1.3/django/core/management/base.py", line 351, in handle
return self.handle_noargs(**options)
File "/home/marcintustin/django/South-0.7.3-py2.5.egg/south/management/commands/syncdb.py", line 99, in handle_noargs
management.call_command('migrate', **options)
File "/home/marcintustin/django/Django-1.3/django/core/management/__init__.py", line 166, in call_command
return klass.execute(*args, **defaults)
File "/home/marcintustin/django/Django-1.3/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/home/marcintustin/django/South-0.7.3-py2.5.egg/south/management/commands/migrate.py", line 105, in handle
ignore_ghosts = ignore_ghosts,
File "/home/marcintustin/django/South-0.7.3-py2.5.egg/south/migration/__init__.py", line 191, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/home/marcintustin/django/South-0.7.3-py2.5.egg/south/migration/migrators.py", line 221, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/home/marcintustin/django/South-0.7.3-py2.5.egg/south/migration/migrators.py", line 298, in migrate_many
interactive=self.interactive)
File "/home/marcintustin/django/South-0.7.3-py2.5.egg/south/db/generic.py", line 808, in send_pending_create_signals
interactive=interactive)
File "/home/marcintustin/django/South-0.7.3-py2.5.egg/south/db/generic.py", line 855, in really_send_create_signal
db=self.db_alias,
File "/home/marcintustin/django/Django-1.3/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/home/marcintustin/django/Django-1.3/django/contrib/auth/management/__init__.py", line 30, in create_permissions
ctype = ContentType.objects.get_for_model(klass)
File "/home/marcintustin/django/Django-1.3/django/contrib/contenttypes/models.py", line 38, in get_for_model
defaults = {'name': smart_unicode(opts.verbose_name_raw)},
File "/home/marcintustin/django/Django-1.3/django/db/models/manager.py", line 135, in get_or_create
return self.get_query_set().get_or_create(**kwargs)
File "/home/marcintustin/django/Django-1.3/django/db/models/query.py", line 385, in get_or_create
obj.save(force_insert=True, using=self.db)
File "/home/marcintustin/django/Django-1.3/django/db/models/base.py", line 460, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/home/marcintustin/django/Django-1.3/django/db/models/base.py", line 560, in save_base
transaction.commit_unless_managed(using=using)
File "/home/marcintustin/django/Django-1.3/django/db/transaction.py", line 124, in commit_unless_managed
connection.commit_unless_managed()
File "/home/marcintustin/django/Django-1.3/django/db/backends/__init__.py", line 183, in commit_unless_managed
self._commit()
File "/home/marcintustin/django/Django-1.3/django/db/backends/__init__.py", line 46, in _commit
return self.connection.commit()
pysqlite2.dbapi2.OperationalError: cannot commit transaction - SQL statements in progress
Basically, I have no idea where to start with fixing this. Any ideas?