Search code examples
mysqldjangoshared-hosting

Database error in Django admin interface on shared hosting


I'm using django with MySQL on a shared hosting. If I'm going in 'users' or 'groups' in administration panel, I see this message:

"Database error. Your database is not configured correctly. Ensure that the appropriate tables were created, and that the corresponding user is allowed to access them."

MySQL database was created with the hosting panel, all tables were created with syncdb command.

Records can be added to table by admin panel (and PHPMyAdmin), but I can't see contents of the table through the Django admin panel.

  • Django 1.6,
  • Python 2.7.5
  • settings.DEBUG=true

I have an access through 'ssh'.

FastCGI config:

import sys, os
venv = 'venv/bin/activate_this.py'
execfile(venv, dict(__file__=venv))
sys.path.insert(0, "path to project")
sys.path.insert(0, "path to python2.7/")
os.environ['DJANGO_SETTINGS_MODULE'] = "project.settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

Solution

  • However problem appears to be wrong configuration .htaccess. Thanks to hosting support.