r4fek / django-cassandra-engine

Django Cassandra Engine - the Cassandra backend for Django
BSD 2-Clause "Simplified" License
365 stars 84 forks source link

Sync_cassandra command doesnt create table #52

Closed vbrchn closed 8 years ago

vbrchn commented 8 years ago

When I executed sync_cassandra command, keyspace was created. but no tables got created. sync_cassandra command displays no errors either. Not sure what is going on. how do i look for what preventing tables being created? I am using following versions of software. cassandra-driver==3.1.0a1.post0 Django==1.9.2 django-cassandra-engine==0.6.4 six==1.10.0

r4fek commented 8 years ago

Hi @vbrchn,

Thanks for the report. Do you have any model defined in your application? Is this application included in INSTALLED_APPS list? Could you paste your models.py file contents here?

vbrchn commented 8 years ago

Thanks for your reply. Do you have any model defined in your application? Could you paste your models.py file contents here?

Yes. They are defined inside model.py. I tried without keyspace for each model

Models.py: from cassandra.cqlengine import columns from cassandra.cqlengine import models

class ExampleModel(models.Model): keyspace = 'n1' id = columns.BigInt(primary_key=True) created_at = columns.DateTime() deleted = columns.Boolean(default=False)

class ExampleModel2(models.Model): keyspace = 'n1' id = columns.BigInt(primary_key=True)

class TestProjectModel(models.Model): keyspace = 'n1' id = columns.UUID(primary_key=True)

\ Is this application included in INSTALLED_APPS list?** Polls app was not included in the installed_apps list when I posted this question. Polls app is included in Installed_apps list now. Now I get the following error File "C:\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django_cassandra_engine-0.6.4-py3.5.egg\django_cassandra_engine\management\commands\sync_cassandra.py ", line 80, in handle_noargs self._import_management() File "C:\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django_cassandra_engine-0.6.4-py3.5.egg\django_cassandra_engine\management\commands\sync_cassandra.py ", line 34, in _import_management import_module('.management', app_name) File "C:\AppData\Local\Programs\Python\Python35-32\lib\importlibinit.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 981, in _gcd_import File "", line 931, in _sanity_check SystemError: Parent module 'polls.apps.PollsConfig' not loaded, cannot perform relative import

r4fek commented 8 years ago

There's clearly something wrong with your app's configuration. I would start with fixing this SystemError: Parent module 'polls.apps.PollsConfig' not loaded, cannot perform relative import.

vbrchn commented 8 years ago

thanks. I corrected the installed_apps to resolve the problem.