hpnhxxwn
hpnhxxwn

Reputation: 189

Django Issue: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet

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?

Upvotes: 0

Views: 3119

Answers (1)

nik_m
nik_m

Reputation: 12086

[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.

Upvotes: 0

Related Questions