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 is still working fine, but I want to get rid of the warning. I do not use the site structure in my project, but the warning disappeared when I added 'django.contrib.sites' to the INSTALLED_APPS list in the settings.py project. So I took care of the warning, and I was happy.
But then the project begins to request the Site in the database in an invitation to enter. Now the thing is that I donβt want the site structure at all. But now it seems to me that I am forced to manage the database record and should take it into account during installation, and when I just try to get rid of the warning.
It appears that the login code in django.contrib.auth relies on it from the code. However, in the Django documentation I found this statement: "site_name: an alias for site.name. If you do not have the site infrastructure installed, this will be set to request.META ['SERVER_NAME']. For more information about sites, see" Website Basics. "
So, the authors of django.contrib.auth do not consider the structure of sites, but judging by my situation, this is not so.
Hence my question. Is it possible to use the Django authentication system (presumably provided) without using the Sites infrastructure and still get rid of this warning and everything related to the sites infrastructure?
source share