rb-site install error: "Table 'reviewboard.auth_user' doesn't - review-board

I use yum install ReviewBoard to install successfully RB but when I run rb-site install, I get the final error: django.db.utils.ProgrammingError: (1146, "Table 'reviewboard.auth_user' doesn't
Any idea on what Im missing? Thanks
Best regards,
XF
* Installing the site...
Building site directories ...
[!] Unable to find the Djblets media path. Make sure Djblets is
installed and try this again.
OK
Building site configuration files ... OK
Creating database ...
[!] Unable to execute the manager command syncdb: cannot import name
execute_manager
[!] Unable to execute the manager command registerscmtools: cannot
import name execute_manager
OK
Performing migrations ...
[!] Unable to execute the manager command evolve: cannot import name
execute_manager
OK
Creating administrator account ... Traceback (most recent call last):
File "/usr/bin/rb-site", line 9, in <module>
load_entry_point('ReviewBoard==1.7.27', 'console_scripts', 'rb-site')()
File "/usr/lib/python2.6/site-packages/reviewboard/cmdline/rbsite.py", line 2170, in main
command.run()
File "/usr/lib/python2.6/site-packages/reviewboard/cmdline/rbsite.py", line 1551, in run
self.show_install_status()
File "/usr/lib/python2.6/site-packages/reviewboard/cmdline/rbsite.py", line 1864, in show_install_status
site.create_admin_user)
File "/usr/lib/python2.6/site-packages/reviewboard/cmdline/rbsite.py", line 1011, in step
func()
File "/usr/lib/python2.6/site-packages/reviewboard/cmdline/rbsite.py", line 556, in create_admin_user
self.admin_password)
File "/usr/lib/python2.6/site-packages/Django-1.6.8-py2.6.egg/django/contrib/auth/models.py", line 195, in create_superuser
**extra_fields)
File "/usr/lib/python2.6/site-packages/Django-1.6.8-py2.6.egg/django/contrib/auth/models.py", line 186, in _create_user
user.save(using=self._db)
File "/usr/lib/python2.6/site-packages/Django-1.6.8-py2.6.egg/django/db/models/base.py", line 545, in save
force_update=force_update, update_fields=update_fields)
File "/usr/lib/python2.6/site-packages/Django-1.6.8-py2.6.egg/django/db/models/base.py", line 573, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/usr/lib/python2.6/site-packages/Django-1.6.8-py2.6.egg/django/db/models
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/usr/lib/python2.6/site-packages/Django-1.6.8-py2.6.egg/django/db/models
using=using, raw=raw)
File "/usr/lib/python2.6/site-packages/Django-1.6.8-py2.6.egg/django/db/models
return insert_query(self.model, objs, fields, **kwargs)
File "/usr/lib/python2.6/site-packages/Django-1.6.8-py2.6.egg/django/db/models
return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/lib/python2.6/site-packages/Django-1.6.8-py2.6.egg/django/db/models
cursor.execute(sql, params)
File "/usr/lib/python2.6/site-packages/Django-1.6.8-py2.6.egg/django/db/backen
return self.cursor.execute(sql, params)
File "/usr/lib/python2.6/site-packages/Django-1.6.8-py2.6.egg/django/db/utils.
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/lib/python2.6/site-packages/Django-1.6.8-py2.6.egg/django/db/backen
return self.cursor.execute(sql, params)
File "/usr/lib/python2.6/site-packages/Django-1.6.8-py2.6.egg/django/db/backen
return self.cursor.execute(query, args)
File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in exe
self.errorhandler(self, exc, value)
File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in
raise errorclass, errorvalue
django.db.utils.ProgrammingError: (1146, "Table 'reviewboard.auth_user' doesn't

Just in case someone else have the same issue
I've downgraded django from 1.6.5 to 1.4.14
and that did the fix
//before you downgrade check the django version within python
python
import django
print django.VERSION
//to downgrade
easy_install django==1.4.14

Related

django loaddata fails because of concurrent database query

I am trying to migrate the database of one my django projects from sqlite to mysql. I first dumped the whole thing with ./manage.py dumpdata > dump.json and prepared the database with ./manage.py migrate and deleted any created data in the tables (This was necessary, as the dump holds all the data).
When I wanted to import the data into the new database with ./manage.py loaddata, there were a lot of errors I was able to resolve, but I can't find the source of this error:
Processed 330984 object(s).Traceback (most recent call last):
File "/app/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.5/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.5/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.5/site-packages/django/core/management/commands/loaddata.py", line 69, in handle
self.loaddata(fixture_labels)
File "/usr/local/lib/python3.5/site-packages/django/core/management/commands/loaddata.py", line 109, in loaddata
self.load_label(fixture_label)
File "/usr/local/lib/python3.5/site-packages/django/core/management/commands/loaddata.py", line 175, in load_label
obj.save(using=self.using)
File "/usr/local/lib/python3.5/site-packages/django/core/serializers/base.py", line 205, in save
models.Model.save_base(self.object, using=using, raw=True, **kwargs)
File "/usr/local/lib/python3.5/site-packages/django/db/models/base.py", line 837, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/usr/local/lib/python3.5/site-packages/django/db/models/base.py", line 904, in _save_table
forced_update)
File "/usr/local/lib/python3.5/site-packages/django/db/models/base.py", line 954, in _do_update
return filtered._update(values) > 0
File "/usr/local/lib/python3.5/site-packages/django/db/models/query.py", line 664, in _update
return query.get_compiler(self.db).execute_sql(CURSOR)
File "/usr/local/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 1199, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/usr/local/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 894, in execute_sql
raise original_exception
File "/usr/local/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 884, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python3.5/site-packages/django/db/backends/utils.py", line 60, in execute
self.db.validate_no_broken_transaction()
File "/usr/local/lib/python3.5/site-packages/django/db/backends/base/base.py", line 448, in validate_no_broken_transaction
"An error occurred in the current transaction. You can't "
django.db.transaction.TransactionManagementError: Problem installing fixture '/path/to/django/dump.json': Could not load auth.User(pk=1): An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.
I already tried to remove all signal receivers, so that none of my own code is run when executing loaddata.
Has anyone else experienced similar behaviour with django's loaddata and managed to get it working?
Context:
python v3.5
django v1.11.4
only stdlib django model fields used
This is more of a workaround than a solution, but it did solve my problem.
After further investigation I realized that the auth.user model somehow triggered the query and broke the import.
The solution was to write a simple script to split the dump into multiple parts (I did not have access to the database anymore) and then import them in the correct order: contenttypes, auth, and the rest.
You can find the script here.
This is how I split up the dump:
./investigate-django-dump.py dump.json extract contenttypes. > contenttypes.json
./investigate-django-dump.py dump.json extract auth. > auth.json
./investigate-django-dump.py dump.json extractnot auth.,contenttypes. > data.json

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.

Hue installation issue

I am new to bigdata technologies/hadoop ecosystem.
As part of one of my assignment I am trying to install and run Hue on my single node hadoop cluster [apache distribution hadoop2.6.0].
I have installed hue as per the instructions provided by many websites:
Downloaded latest hue tar file
Unzipped it at one location
Ran sudo make install
It installed hue in /usr/local/hue directory
Updated hue.ini file with required details of my cluster.
When I am trying to access the newly installed hue through web UI using ':8888', it is showing me following error page:
Traceback (most recent call last):
File "/usr/local/hue/desktop/core/src/desktop/lib/wsgiserver.py", line
1198, in communicate
req.respond()
File "/usr/local/hue/desktop/core/src/desktop/lib/wsgiserver.py", line 568,
in respond
self._respond()
File "/usr/local/hue/desktop/core/src/desktop/lib/wsgiserver.py", line 580,
in _respond
response = self.wsgi_app(self.environ, self.start_response)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/handlers/wsgi.py",
line 206, in call
response = self.get_response(request)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/handlers/base.py",
line 194, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/handlers/base.py",
line 236, in handle_uncaught_exception
return callback(request, **param_dict)
File "/usr/local/hue/desktop/core/src/desktop/views.py", line 304, in serve_500_error
return render("500.mako", request, {'traceback': traceback.extract_tb(exc_info[2])})
File "/usr/local/hue/desktop/core/src/desktop/lib/django_util.py", line
225, in render
**kwargs)
File "/usr/local/hue/desktop/core/src/desktop/lib/django_util.py", line
146, in _render_to_response
return django_mako.render_to_response(template, *args, **kwargs)
File "/usr/local/hue/desktop/core/src/desktop/lib/django_mako.py", line
125, in render_to_response
return HttpResponse(render_to_string(template_name, data_dictionary), **kwargs)
File "/usr/local/hue/desktop/core/src/desktop/lib/django_mako.py", line
114, in render_to_string_normal
result = template.render(**data_dict)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Mako-0.8.1-py2.6.egg/mako/template.py",
line 443, in render
return runtime.render(self, self.callable, args, data)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Mako-0.8.1-py2.6.egg/mako/runtime.py",
line 786, in _render
**_kwargs_for_callable(callable_, data))
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Mako-0.8.1-py2.6.egg/mako/runtime.py",
line 818, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Mako-0.8.1-py2.6.egg/mako/runtime.py",
line 844, in _exec_template
callable_(context, *args, **kwargs)
File "/tmp/tmpjqe8jG/desktop/500.mako.py", line 103, in render_body
M_writer(unicode( commonfooter(messages) ))
File "/usr/local/hue/desktop/core/src/desktop/views.py", line 388, in commonfooter
hue_settings = Settings.get_settings()
File "/usr/local/hue/desktop/core/src/desktop/models.py", line 59, in get_settings
settings, created = Settings.objects.get_or_create(id=1)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/models/manager.py",
line 154, in get_or_create
return self.get_queryset().get_or_create(**kwargs)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/models/query.py",
line 391, in get_or_create
six.reraise(*exc_info)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/models/query.py",
line 383, in get_or_create
obj.save(force_insert=True, using=self.db)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/models/base.py",
line 545, in save
force_update=force_update, update_fields=update_fields)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/models/base.py",
line 573, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/models/base.py",
line 654, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/models/base.py",
line 687, in _do_insert
using=using, raw=raw)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/models/manager.py",
line 232, in _insert
return insert_query(self.model, objs, fields, **kwargs)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/models/query.py",
line 1514, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/models/sql/compiler.py",
line 903, in execute_sql
cursor.execute(sql, params)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/utils.py",
line 99, in __exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/usr/local/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/backends/sqlite3/base.py", line 452, in execute
return Database.Cursor.execute(self, query, params)
OperationalError: attempt to write a readonly database
Not sure what does it mean, please help me in resolving this issue
Regards,
Bhupesh
Got it :-)
I was facing this issue because of the hue directory ownership.
I changed the owner of my /usr/local/hue folder :
$ sudo chown -R hue:hue /usr/local/hue
and then tried accessing the URL, it worked. :-)
//Bhupesh

django dumpdata => load on heroku

I'm trying to load the data from my sqlite database to heroku postgres but it is not working.
First I ran:
manage.py dumpdata --indent 1 > data.json
and then I tried to upload it to heroku with (after I committed the file to heroku):
heroku run python manage.py loaddata data.json
but it just didn't work...
it gave me errors:
Running `python manage.py loaddata data.json` attached to terminal... up, run.92
01
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/_
_init__.py", line 385, in execute_from_command_line
utility.execute()
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/_
_init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/b
ase.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/b
ase.py", line 338, in execute
output = self.handle(*args, **options)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/c
ommands/loaddata.py", line 61, in handle
self.loaddata(fixture_labels)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/c
ommands/loaddata.py", line 91, in loaddata
self.load_label(fixture_label)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/c
ommands/loaddata.py", line 148, in load_label
obj.save(using=self.using)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/serializers/
base.py", line 173, in save
models.Model.save_base(self.object, using=using, raw=True)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/base.py
", line 617, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, upda
te_fields)
File "/app/.heroku/python/lib/python2.7/sitepackages/django/db/models/base.py
", line 679, in _save_table
forced_update)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/base.py
", line 723, in _do_update
return filtered._update(values) > 0
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.p
y", line 600, in _update
return query.get_compiler(self.db).execute_sql(CURSOR)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/com
piler.py", line 1004, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/com
piler.py", line 786, in execute_sql
cursor.execute(sql, params)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils
.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils
.py", line 65, in execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: Problem installing fixture '/app/data.json': C
ould not load contenttypes.ContentType(pk=1): relation "django_content_type" does not exist
LINE 1: UPDATE "django_content_type" SET "name" = 'log entry', "app_...
What may be the problem?
The end of the stacktrace has the key:
relation "django_content_type" does not exist
LINE 1: UPDATE "django_content_type" SET "name" = 'log entry', "app_...
The table django_content_type does not exist. Try running the migrations:
heroku run python manage.py migrate
or, if you are using an old version:
heroku run python manage.py setupdb

I can't save data to database with Django and SQL Anywhere 11

I have connected django with sql anywhere 11 database, I have follow the instructions on the page SQL Anywhere Django Driver from github.
I have created the database with this command:
C:\>dbinit -z UCA django.db --> (database created successful)
I have started the Database Server with command:
C:\>dbsrv11 django.db --> (database server started successful)
I have created my project with:
C:\>django-admin.py startproject mysite (at this point all it's ok)
I have edited the file mysite/mysite/settings.py and I have changed the DATABASES setting with this:
DATABASES = {
'default': {
'ENGINE': 'sqlany_django',
'NAME': 'django',
'USER': 'dba',
'PASSWORD': 'sql',
'OPTIONS': {'eng': 'django'}
}
}
When I want to sync database using this command:
c:/mysite>python manage.py syncdb
the prompt show me a error message (the error message is shown below)
I have connected Sybase Central to django.db I see the tables was created.
but when I try save data to the tables this data wasn't recorded
even when I have created the superuser with this command:
c:\mysite>python manage.py createsuperuser --username=joe --email=joe#example.com
Password:123
Password (again):123
Superuser created successfully.
I querying the datebase with:
select * from auth_user
No rows are shown
The data aren't saved
I have an environment for test with this features:
O.S.: Windows XP
DB Engine: SQL Anywhere 11 with EBF 3069
Python 2.7
Django 1.6.1
Setuptools installed
PIP installed
sqlanydb installed
sqlany-django installed
Here is the error message
C:\mysite>python manage.py syncdb
Creating tables ...
Creating table django_admin_log
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table Personal_persona
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
399, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 242,
in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 285,
in execute
output = self.handle(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 415,
in handle
return self.handle_noargs(**options)
File "C:\Python27\lib\site-packages\django\core\management\commands\syncdb.py"
, line 112, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "C:\Python27\lib\site-packages\django\core\management\sql.py", line 216,
in emit_post_sync_signal
interactive=interactive, db=db)
File "C:\Python27\lib\site-packages\django\dispatch\dispatcher.py", line 185,
in send
response = receiver(signal=self, sender=sender, **named)
File "C:\Python27\lib\site-packages\django\contrib\auth\management\__init__.py
", line 101, in create_permissions
auth_app.Permission.objects.using(db).bulk_create(perms)
File "C:\Python27\lib\site-packages\django\db\models\query.py", line 356, in b
ulk_create
self._batched_insert(objs_without_pk, fields, batch_size)
File "C:\Python27\lib\site-packages\django\db\models\query.py", line 835, in _
batched_insert
using=self.db)
File "C:\Python27\lib\site-packages\django\db\models\manager.py", line 232, in
_insert
return insert_query(self.model, objs, fields, **kwargs)
File "C:\Python27\lib\site-packages\django\db\models\query.py", line 1511, in
insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", line 90
3, in execute_sql
cursor.execute(sql, params)
File "C:\Python27\lib\site-packages\django\db\backends\util.py", line 69, in e
xecute
return super(CursorDebugWrapper, self).execute(sql, params)
File "C:\Python27\lib\site-packages\django\db\backends\util.py", line 53, in e
xecute
return self.cursor.execute(sql, params)
File "C:\Python27\lib\site-packages\django\db\utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "C:\Python27\lib\site-packages\django\db\backends\util.py", line 53, in e
xecute
return self.cursor.execute(sql, params)
File "C:\Python27\lib\site-packages\sqlany_django\base.py", line 87, in execut
e
ret = self.cursor.execute(trace(query), trace(args))
File "C:\Python27\lib\site-packages\sqlanydb.py", line 714, in execute
self.executemany(operation, [parameters])
File "C:\Python27\lib\site-packages\sqlanydb.py", line 685, in executemany
bind_count = self.api.sqlany_num_params(self.stmt)
File "C:\Python27\lib\site-packages\sqlanydb.py", line 619, in __stmt_get
self.handleerror(*self.parent.error())
File "C:\Python27\lib\site-packages\sqlanydb.py", line 613, in handleerror
eh(self.parent, self, errorclass, errorvalue)
File "C:\Python27\lib\site-packages\sqlanydb.py", line 342, in standardErrorHa
ndler
raise errorclass(errorvalue)
django.db.utils.OperationalError: Syntax error near ',' on line 1
Sorry, but the SQL Anywhere Django driver requires SQL Anywhere v12 or higher; you cannot use it with SQL Anywhere v11. I have confirmed that the driver uses features of the database server that were not supported in version 11.
Disclaimer: I work for SAP in SQL Anywhere engineering.