Comments (14)
You have to add at least one CQL model in django application, which has to be added to INSTALLED_APPS. Then run syncdb and your model(s) should be synced automatically. Good luck!
from django-cassandra-engine.
I believe I did that... I added the model as in the wiki : class ExampleModel(Model)
Is that not what you mean?
from django-cassandra-engine.
In case it matters:
➜ ~ sudo pip list |egrep -i 'cass|djan'
cassandra-driver (2.1.0)
Django (1.7)
django-cassandra-engine (0.0.6)
django-celery (3.1.16)
django-celery-with-redis (3.0)
django-jinja (1.0.4)
djangorestframework (2.4.3)
djangotoolbox (1.6.2)
from django-cassandra-engine.
Could you paste your models.py here? Are you sure this app is in INSTALLED_APPS?
from django-cassandra-engine.
It's same as the wiki, and my app was added to INSTALLED_APPS automatically by PyCharm... I did double check :)
myapp/models.py
import uuid
from cqlengine import columns
from cqlengine.models import Model
class ExampleModel(Model):
read_repair_chance = 0.05 # optional - defaults to 0.1
example_id = columns.UUID(primary_key=True, default=uuid.uuid4)
example_type = columns.Integer(index=True)
created_at = columns.DateTime()
description = columns.Text(required=False)
from django-cassandra-engine.
You're doing something wrong. Take a look at testproject in this repo. It works for sure on Django 1.7. We're using this engine in many projects without any problems..
from django-cassandra-engine.
I am sure I am.. I'll try and start from the test project. Thanks a lot.
from django-cassandra-engine.
No problem. Let me know when you solve it. Good luck!
from django-cassandra-engine.
@lrhazi have you resolved your issue?
from django-cassandra-engine.
sorry know. have not had time to dig into it further. feel free to close since nobody else seems to be reproducing my issues.
from django-cassandra-engine.
I had this issue as well, until I looked at the example and noticed that django_cassandra_engine was the very last app in INSTALLED_APPS. After adjusting my list accordingly, syncdb created the tables defined in my app. This ordering dependency should perhaps be more explicitly stated in the docs.
from django-cassandra-engine.
@wryfi but it is! The docs says:
IMPORTANT: This app should be last on INSTALLED_APPS list.
from django-cassandra-engine.
I had this issue. But I solved it. Please try ./manage.py syncdb --database cassandra
. cassandra
is your cassandra database name in settings.py
.
My code is below.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
},
'cassandra': {
'ENGINE': 'django_cassandra_engine',
'NAME': 'db',
'TEST_NAME': 'test_db',
'HOST': '127.0.0.1',
'OPTIONS': {
'replication': {
'strategy_class': 'SimpleStrategy',
'replication_factor': 1
}
}
}
}
from django-cassandra-engine.
http://r4fek.github.io/django-cassandra-engine/faq/
The doc says it should be first application. But for me neither making it first or last working.
from django-cassandra-engine.
Related Issues (20)
- Can't delete from admin - You cannot .filter() on a DjangoCassandraQuerySet which has been ordered using python HOT 1
- Support for values_list 'named' keyword argument
- Django 3.0 support HOT 4
- admin ui HOT 1
- TypeError: sql_flush() got an unexpected keyword argument 'reset_sequences' HOT 2
- Date must be mapped to DateField in serializers
- Creating keyspace but models are not syncing HOT 2
- Multiple cassandra configurations HOT 5
- Stale Cached Response on GET HOT 2
- Can I use Scylla's scylla-driver with this? HOT 1
- built-in ORM HOT 3
- Error while connecting to AWS Keyspace HOT 2
- django cassnadra migration HOT 1
- Does this library support connecting through TLS (if possible, with client cert auth)?
- Discord server HOT 1
- Can't connect to K8ssandra in minikube, problem with settings HOT 1
- django 3.2 LTS support & Python 3.7+ only
- Looking for a way to dump any CQL statement to logging
- cassandra.cluster.NoHostAvailable
- sync_cassandra command fails after syncing 1 model HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-cassandra-engine.