The following warning appears twice when I run ./manage.py runserver
after upgrading Django from 1.7 to 1.8.
.../django/contrib/sites/models.py:78: RemovedInDjango19Warning: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
The project still runs fine, but I want to get rid of the warning. I'm not using the Sites framework in my project, but the warning disappeared when I added 'django.contrib.sites'
to the INSTALLED_APPS
list in the project's settings.py
. So that took care of the warning and I was happy.
But then the project starts demanding a Site in the database at the login prompt. Now, the whole thing is that I don't want the Sites framework at all. But now I seem forced to manage a database entry and need to consider it during installation and such when I'm just trying to get rid of a warning.
It appears that the login code in django.contrib.auth
relies on it from the code. However, in Django's documentation I found this assertion: "site_name: An alias for site.name. If you don’t have the site framework installed, this will be set to the value of request.META['SERVER_NAME']. For more on sites, see The “sites” framework."
So it appears that the authors of django.contrib.auth
consider the Sites framework optional, but judging from my situation, it isn't.
Hence my question. Is it possible to use Django's (presumably contributed) authentication system without using the Sites framework at all and still getting rid of that warning and everything related to the Sites framework?