Giter Club home page Giter Club logo

Comments (14)

r4fek avatar r4fek commented on July 20, 2024

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.

lrhazi avatar lrhazi commented on July 20, 2024

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.

lrhazi avatar lrhazi commented on July 20, 2024

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.

r4fek avatar r4fek commented on July 20, 2024

Could you paste your models.py here? Are you sure this app is in INSTALLED_APPS?

from django-cassandra-engine.

lrhazi avatar lrhazi commented on July 20, 2024

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.

r4fek avatar r4fek commented on July 20, 2024

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.

lrhazi avatar lrhazi commented on July 20, 2024

I am sure I am.. I'll try and start from the test project. Thanks a lot.

from django-cassandra-engine.

r4fek avatar r4fek commented on July 20, 2024

No problem. Let me know when you solve it. Good luck!

from django-cassandra-engine.

r4fek avatar r4fek commented on July 20, 2024

@lrhazi have you resolved your issue?

from django-cassandra-engine.

lrhazi avatar lrhazi commented on July 20, 2024

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.

wryfi avatar wryfi commented on July 20, 2024

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.

r4fek avatar r4fek commented on July 20, 2024

@wryfi but it is! The docs says:
IMPORTANT: This app should be last on INSTALLED_APPS list.

from django-cassandra-engine.

shunkit avatar shunkit commented on July 20, 2024

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.

 avatar commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.