0
votes

I am completely new to Django. I created a class:

from django.db import models
from cqlengine import columns

class Rsvpstream(models.Model):
    venue_name = columns.Text()
    venue_lon = columns.Decimal(required=False)
    venue_lat = columns.Decimal(required=False)
    venue_id = columns.Integer()
    visibility = columns.Text()
    response = columns.Text()
    guests = columns.Integer()
    member_id = columns.Integer()
    member_name = columns.Text()
    rsvp_id = columns.Integer(primary_key=True)
    rsvp_last_modified_time = columns.DateTime(required=False)
    event_name = columns.Text()
    event_time = columns.DateTime(required=False)
    event_url = columns.Text()
    group_topic_names = columns.Text()
    group_country = columns.Text()
    group_state = columns.Text()
    group_city = columns.Text()
    group_name = columns.Text()
    group_lon = columns.Integer()
    group_lat = columns.Integer()
    group_id = columns.Integer()

When I run this code, I got the following errors:

Traceback (most recent call last): File "", line 1, in File "/Users/hpnhxxwn/anaconda/envs/magenta/lib/python2.7/site-packages/django/db/models/base.py", line 105, in new app_config = apps.get_containing_app_config(module) File "/Users/hpnhxxwn/anaconda/envs/magenta/lib/python2.7/site-packages/django/apps/registry.py", line 237, in get_containing_app_config self.check_apps_ready() File "/Users/hpnhxxwn/anaconda/envs/magenta/lib/python2.7/site-packages/django/apps/registry.py", line 124, in check_apps_ready raise AppRegistryNotReady("Apps aren't loaded yet.") django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

Can someone please advise how to proceed?

1
Did my solution work for you?nik_m
Hi nik_m, I am new to this, so am reading the document for the settings.py. I made a settings.py, and tried a run, but it complains about mising SECRET_KEY: The SECRET_KEY setting must not be emptyhpnhxxwn
So, do you have a SECRET_KEY in your settings.py file?nik_m
I set it to "", and hoping the compiler won't say that message again, but still gives me the same error.hpnhxxwn
You must not set it to an empty string! The first time you run django-admin startproject project_name, Django automatically creates a settings.py for you. Inside there, you should not change the SECRET_KEY string.nik_m

1 Answers

0
votes

[UPDATE]: According the "get started section" you should run the command /manage.py sync_table in order for the tables to be created. Also take a look at this post (if you haven't already).

Also, maybe the django-cassandra-engine instructions might help you.

Have you added your app (where the model resides) inside your INSTALLED_APPS list (which lives inside your settings.py file)?

Like this (assuming that your app is named stream):

INSTALLED_APPS = [
    'django.contrib.admin',
    ...
    'stream.apps.StreamConfig',  # <-- this should be added
]

Of course, after that, you should run ./manage.py makemigrations and ./manage.py migrate.