0

I am trying to use this app https://github.com/benliles/django-chance in my application. My Django version is 1.9. I am getting the following error:

python manage.py runserver Unhandled exception in thread started by <function wrapper at 0x7f4931ce85f0> Traceback (most recent call last): File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run autoreload.raise_last_exception() File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception six.reraise(*_exception) File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/apps/config.py", line 90, in create module = import_module(entry) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/home/bewithaman/Projects/Event-Management-System/chance/__init__.py", line 1, in <module> from chance import signals File "/home/bewithaman/Projects/Event-Management-System/chance/signals.py", line 7, in <module> from chance.models import Registration File "/home/bewithaman/Projects/Event-Management-System/chance/models.py", line 2, in <module> from django.contrib.auth.models import User File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/contrib/auth/models.py", line 4, in <module> from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/contrib/auth/base_user.py", line 49, in <module> class AbstractBaseUser(models.Model): File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/db/models/base.py", line 94, in __new__ app_config = apps.get_containing_app_config(module) File "/home/bewithaman/Projects/ems/local/lib/python2.7/site-packages/django/apps/registry.py", line 239, in get_containing_app_config self.check_apps_ready() File "/home/bewithaman/Projects/ems/local/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. 

The file tree of website:-

├── chance │   ├── admin.py │   ├── admin.pyc │   ├── forms.py │   ├── forms.pyc │   ├── __init__.py │   ├── __init__.pyc │   ├── migrations │   │   ├── 0001_initial.py │   │   ├── 0002_add_eventchoice_allow_multiple.py │   │   ├── 0002_add_eventchoice_allow_multiple.pyc │   │   ├── 0003_add_created_and_label.py │   │   ├── 0004_add_registration_owner.py │   │   ├── __init__.py │   │   └── __init__.pyc │   ├── models.py │   ├── models.pyc │   ├── signals.py │   ├── signals.pyc │   ├── templates │   │   └── chance │   │   ├── event_detail.html │   │   ├── event_list.html │   │   ├── registration_email_manager_subject.txt │   │   ├── registration_email_subject.txt │   │   ├── registration_email.txt │   │   └── registration_form.html │   ├── urls.py │   ├── urls.pyc │   ├── views.py │   └── views.pyc ├── EMS │   ├── __init__.py │   ├── __init__.pyc │   ├── settings.py │   ├── settings.pyc │   ├── urls.py │   ├── urls.pyc │   ├── wsgi.py │   └── wsgi.pyc ├── manage.py ├── media │   └── profile_images │   ├── 20140810_175920.jpg │   ├── IMG-20150215-WA0013.jpg │   ├── IMG-20150215-WA0015.jpg │   ├── IMG-20150215-WA0018-1.jpg │   ├── IMG-20150304-WA0005.jpg │   └── Shubham_20140216_234708-1.jpg ├── notifications │   ├── admin.py │   ├── admin.pyc │   ├── apps.py │   ├── apps.pyc │   ├── __init__.py │   ├── __init__.pyc │   ├── migrations │   │   ├── 0001_initial.py │   │   ├── 0001_initial.pyc │   │   ├── __init__.py │   │   └── __init__.pyc │   ├── models.py │   ├── models.pyc │   ├── signals.py │   ├── signals.pyc │   ├── static │   │   └── notifications │   │   └── notify.js │   ├── templates │   │   └── notifications │   │   ├── list.html │   │   ├── notice.html │   │   └── test_tags.html │   ├── templatetags │   │   ├── __init__.py │   │   ├── __init__.pyc │   │   ├── notifications_tags.py │   │   └── notifications_tags.pyc │   ├── tests │   │   ├── __init__.py │   │   ├── settings.py │   │   ├── static │   │   │   └── notifications │   │   │   └── live-test.js │   │   ├── templates │   │   │   └── test_live.html │   │   ├── tests.py │   │   ├── urls.py │   │   └── views.py │   ├── urls.py │   ├── urls.pyc │   ├── utils.py │   ├── utils.pyc │   ├── views.py │   └── views.pyc ├── registeration │   ├── admin.py │   ├── admin.pyc │   ├── forms.py │   ├── forms.pyc │   ├── __init__.py │   ├── __init__.pyc │   ├── migrations │   │   ├── 0001_initial.py │   │   ├── 0001_initial.pyc │   │   ├── 0002_auto_20160211_1250.py │   │   ├── 0002_auto_20160211_1250.pyc │   │   ├── 0003_event_participants.py │   │   ├── 0003_event_participants.pyc │   │   ├── __init__.py │   │   └── __init__.pyc │   ├── models.py │   ├── models.pyc │   ├── tests.py │   ├── urls.py │   ├── urls.pyc │   ├── views.py │   └── views.pyc ├── static │   ├── css │   │   ├── bootstrap.css │   │   ├── bootstrap-fluid-adj.css │   │   ├── bootstrap.min.css │   │   ├── bootstrap-responsive.css │   │   └── bootstrap-responsive.min.css │   ├── img │   │   ├── glyphicons-halflings.png │   │   ├── glyphicons-halflings-white.png │   │   └── twd.ico │   └── js │   ├── bootstrap.js │   ├── bootstrap.min.js │   ├── jquery-2.0.3.js │   ├── jquery-2.0.3.min.js │   └── rango-ajax.js └── templates └── registeration ├── base.html ├── events.html ├── index.html ├── login.html ├── profile.html └── register.html 

I have followed all the instructions but I am not able to figure out what is wrong. Please help me.

1 Answer 1

5

The django-chance app you are using has not been updated in several years, and does not appear to support Django 1.9. You can either use a different app instead, or try to update it to work with Django 1.9.

This part of the traceback shows that it imports signals.py in the __init__.py, which tries to import models before the apps are loaded.

 File "/home/bewithaman/Projects/Event-Management-System/chance/__init__.py", line 1, in <module> from chance import signals File "/home/bewithaman/Projects/Event-Management-System/chance/signals.py", line 7, in <module> from chance.models import Registration 

Remove this line from your chance/__init__.py file

from chance import signals 

Then create an change/apps.py file, and define an app config class that imports the signals in the ready() method.

from django.apps import AppConfig class ChanceConfig(AppConfig): def ready(self): from . import signals 

Finally, update your INSTALLED_APPS setting to use your config.

INSTALLED_APPS = [ ... 'chance.apps.ChanceConfig', ... ] 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.