Я развертываю проект Django 1.10 на сервере Ubuntu с Apache и mod_wsgi. Я получаю следующую ошибку 500, которую не могу решить:
RuntimeError: класс модели django.contrib.contenttypes.models.ContentType не объявляет явный app_label и не находится в приложении в INSTALLED_APPS.
installed_apps в settings.py:
INSTALLED_APPS = [
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'dashboard',
]
wsgi.py:
sys.path.append('/home/x_dashboard/x_dashboard/')
activate_this = os.path.expanduser("/home/x_dashboard/.venv/bin/activate_this.py")
execfile(activate_this, dict(__file__=activate_this))
os.environ['PYTHON_EGG_CACHE'] = '/home/x_dashboard/x_dashboard/.python-egg'
os.environ['DJANGO_SETTINGS_MODULE'] = 'x_dashboard.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Конфигурация Apache:
<VirtualHost *:80>
#ServerName example.com
#ServerAlias www.example.com
#ServerAdmin [email protected]
DocumentRoot /home/x_dashboard/x_dashboard/
#ErrorLog /var/www/html/example.com/logs/error.log
#CustomLog /var/www/html/example.com/logs/access.log combined
WSGIScriptAlias / /home/x_dashboard/x_dashboard/x_dashboard/wsgi_local.py
#Alias /robots.txt /var/www/html/example.com/public_html/robots.txt
#Alias /favicon.ico /var/www/html/example.com/public_html/favicon.ico
#Alias /images /var/www/html/example.com/public_html/images
Alias /static /var/www/x_dashboard/static
<Directory /home/x_dashboard/x_dashboard/x_dashboard/>
<Files wsgi.py>
Order deny,allow
Allow from all
Require all granted
</Files>
</Directory>
</VirtualHost>
В документации Django говорится, что для модели, которые не принадлежат приложению, определенному в installed_apps. Однако django.contrib.contenttypes определен в installed_apps.
Любая помощь приветствуется.