Giter VIP home page Giter VIP logo

Comments (11)

r4fek avatar r4fek commented on August 20, 2024

Please make sure that your DATABASES settings are correct. Looking at testproject may help with it.

from django-cassandra-engine.

lrhazi avatar lrhazi commented on August 20, 2024

Maybe the full stack is important:

Performing system checks...

Unhandled exception in thread started by <function wrapper at 0x7f132c4ade60>
System check identified no issues (0 silenced).
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 222, in wrapper
fn(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 107, in inner_run
self.check_migrations()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 159, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 17, in init
self.loader = MigrationLoader(self.connection)
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 48, in init
self.build_graph()
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 179, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
self.ensure_schema()
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/recorder.py", line 49, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.get_table_list(self.connection.cursor()):
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/init.py", line 1383, in get_table_list
raise NotImplementedError('subclasses of BaseDatabaseIntrospection may require a get_table_list() method')
NotImplementedError: subclasses of BaseDatabaseIntrospection may require a get_table_list() method

from django-cassandra-engine.

r4fek avatar r4fek commented on August 20, 2024

This tells you that django is using it's default database wrapper instead of cassandra's. Once again: something is wrong with your settings.. Maybe you forgot to add 'django_cassandra_engine' to your installed apps?

from django-cassandra-engine.

lrhazi avatar lrhazi commented on August 20, 2024

Yes, am sure am doing something wrong.. I just need to find out what :)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'api',
#the docs say this one has to be last:
'django_cassandra_engine',
)

from django-cassandra-engine.

r4fek avatar r4fek commented on August 20, 2024

Try with "projectname.api' :)

from django-cassandra-engine.

lrhazi avatar lrhazi commented on August 20, 2024

no luck with that change. 'api' app is not inside 'projectname" which is how PyCharm seems to like to do these things...

Is it normal that this does not mention keyspace and models being processed:

➜ /tmp git clone https://github.com/r4fek/django-cassandra-engine.git
Cloning into 'django-cassandra-engine'...
remote: Counting objects: 211, done.
remote: Total 211 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (211/211), 32.90 KiB | 0 bytes/s, done.
Resolving deltas: 100% (123/123), done.
Checking connectivity... done.
➜ /tmp cd django-cassandra-engine/testproject
➜ testproject git:(master) ./manage.py syncdb
Operations to perform:
Synchronize unmigrated apps: django_cassandra_engine, app
Apply all migrations: admin, contenttypes, auth, sessions
Synchronizing apps without migrations:
Creating tables...
Installing custom SQL...
Installing indexes...
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying sessions.0001_initial... OK

You have installed Django's auth system, and don't have any superusers defined.
Would you like to create one now? (yes/no): no

from django-cassandra-engine.

lrhazi avatar lrhazi commented on August 20, 2024

From the testproject settings DATABASES, if I remove 'default' and rename 'cassandra' to 'default', I seem to reproduce my problem:

➜ testproject git:(master) ✗ ./manage.py syncdb
Creating keyspace db..
➜ testproject git:(master) ✗

from django-cassandra-engine.

r4fek avatar r4fek commented on August 20, 2024

It works. Closing

from django-cassandra-engine.

barisdinc avatar barisdinc commented on August 20, 2024

Still have problem when I use cassandra as default db...
in testproject sqllite3 is defaultdb.....
if I try to set cassandra as default db using the sample in README file as follows, I also get the NotImplementedError: subclasses of BaseDatabaseIntrospection may require a get_table_list() method error :

DATABASES = {
    'default': {
        'ENGINE': 'django_cassandra_engine',
        'NAME': 'db',
        'TEST_NAME': 'test_db',
        'HOST': '12.0.0.1',
        'OPTIONS': {
            'replication': {
                'strategy_class': 'SimpleStrategy',
                'replication_factor': 1
            }
        }
    }
}

Is there a way that I can use cassandra as default database of django.....????

from django-cassandra-engine.

r4fek avatar r4fek commented on August 20, 2024

Yes, there is. But your default django apps like admin, auth, contentypes will not work with cassandra, as they require relational database in order to work properly.

If you don't need django apps, django_cassandra_engine could be used as default database alias. We're using it at Opera in many projects.

If you have any problems with running this engine please see the docs (especially FAQ section). http://r4fek.github.io/django-cassandra-engine/

from django-cassandra-engine.

r4fek avatar r4fek commented on August 20, 2024

Could you guys check it with v0.1.1?

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.