cqlengine

Python cassandra-driver OperationTimeOut on every query in Celery task

浪子不回头ぞ 提交于 2021-02-18 22:29:12
问题 I have a problem with every insert query (little query) which is executed in celery tasks asynchronously. In sync mode when i do insert all done great, but when it executed in apply_async() i get this: OperationTimedOut('errors=errors=errors={}, last_host=***.***.*.***, last_host=None, last_host=None',) Traceback: Traceback (most recent call last): File "/var/nfs_www/***/env_v0/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task R = retval = fun(*args, **kwargs)

Python cassandra-driver OperationTimeOut on every query in Celery task

早过忘川 提交于 2021-02-18 22:28:11
问题 I have a problem with every insert query (little query) which is executed in celery tasks asynchronously. In sync mode when i do insert all done great, but when it executed in apply_async() i get this: OperationTimedOut('errors=errors=errors={}, last_host=***.***.*.***, last_host=None, last_host=None',) Traceback: Traceback (most recent call last): File "/var/nfs_www/***/env_v0/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task R = retval = fun(*args, **kwargs)

Django migration raised TypeError: Unknown option(s) for sync_cassandra command

你。 提交于 2019-12-11 18:42:31
问题 I trying to use Cassandra database for my Django rest application. When I am using SQLite database the migration working fine. However, when I am changing the database to use cassandra I am getting the following error. TypeError: Unknown option(s) for sync_cassandra command: app_label, fake, fake_initial, interactive, migration_name, run_syncdb. Valid options are database, help, no_color, pythonpath, settings, skip_checks, stderr, stdout, traceback, verbosity, version. I am running cassandra

Django RESTful API error “type object 'User' has no attribute '_meta'”

ぐ巨炮叔叔 提交于 2019-12-11 03:32:42
问题 I'm trying to build RESTful API's with django-rest-framework and cassandra, following step by step the official django-rest-framework tutorial at Django-rest-framework I encountered this error Traceback: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 132. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py" in wrapped_view 58. return view_func(*args, *

cqlengine multilpe keyspaces

拥有回忆 提交于 2019-12-08 03:49:08
问题 I am using cassandra from python 3.4.0 with cassandra-driver 2.5.0 (and cqlengine models) . App data are distributed in: one keyspace for management and one keyspace per user. i need to query two keyspaces: master+custom. I have coded a tiny class for keyspace switching used like this: with keyspace(new_keyspace): #do stuff with new_keyspace #do stuff with previous keyspace My first version was: class keyspace(object): def __init__(self, new_keyspace): self.new_keyspace = new_keyspace self