Reputation: 73
I'm currently writing a web-application with Python Django. My problem is, that i recently installed django-relationships, added it to my INSTALLED_APPS inside the settings.py.
Since then I'm getting this wired error and I have NO Idea what it means.
Somebody out there can help me?
Unhandled exception in thread started by <function wrapper at 0x10c6fdcf8>
Traceback (most recent call last):
File "/Users/Maximilian_H/Documents/SkyPixelServernetzwerk/Coding-Projects/Website/lib/python2.7/site-
packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/Users/Maximilian_H/Documents/SkyPixelServernetzwerk/Coding-Projects/Website/lib/python2.7/site-
packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/Users/Maximilian_H/Documents/SkyPixelServernetzwerk/Coding-Projects/Website/lib/python2.7/site-
packages/django/utils/autoreload.py", line 249, in raise_last_exception
six.reraise(*_exception)
File "/Users/Maximilian_H/Documents/SkyPixelServernetzwerk/Coding-Projects/Website/lib/python2.7/site-
packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/Users/Maximilian_H/Documents/SkyPixelServernetzwerk/Coding-Projects/Website/lib/python2.7/site-packages/django/__init__.py",
line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/Maximilian_H/Documents/SkyPixelServernetzwerk/Coding-Projects/Website/lib/python2.7/site-
packages/django/apps/registry.py", line 108, in populate
app_config.import_models(all_models)
File "/Users/Maximilian_H/Documents/SkyPixelServernetzwerk/Coding-Projects/Website/lib/python2.7/site-
packages/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/Maximilian_H/Documents/SkyPixelServernetzwerk/Coding-Projects/Website/lib/python2.7/site-
packages/relationships/models.py", line 3, in <module>
from django.contrib.sites.models import Site
File "/Users/Maximilian_H/Documents/SkyPixelServernetzwerk/Coding-Projects/Website/lib/python2.7/site-
packages/django/contrib/sites/models.py", line 83, in <module>
class Site(models.Model):
File "/Users/Maximilian_H/Documents/SkyPixelServernetzwerk/Coding-Projects/Website/lib/python2.7/site-
packages/django/db/models/base.py", line 102, in __new__
"INSTALLED_APPS." % (module, name)
RuntimeError: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
Upvotes: 2
Views: 1991
Reputation: 1
add django.contrib.sites
to your INSTALLED_APPS
and SITE_ID = 1
in your settings.py that solved my problem
Upvotes: 0
Reputation: 53699
It seems django-relationships
depends on the Site
model. You must add django.contrib.sites
to your INSTALLED_APPS
as well.
The second error indicates that django-relationships
tries to import create_many_related_manager
from django.db.models.fields.related
. This function was removed in Django 1.9. If a newer version is available, you can try if that works. If not, django-relationships
is not usable with Django 1.9.
Upvotes: 3