0

I cannot run application because Django cannot create table "app.django_session". Using python 3.4, Django Framework and MySQL. I tried syncdb command. I dropped old database and created a new one, after that it doesn't work.

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/django/contrib/sessions/backends/base.py", line 176, in _get_session
    return self._session_cache
AttributeError: 'SessionStore' object has no attribute '_session_cache'

...

  File "/usr/local/lib/python3.4/dist-packages/MySQLdb/connections.py", line 280, in query
    _mysql.connection.query(self, query)
django.db.utils.ProgrammingError: (1146, "Table 'app.django_session' doesn't exist")
Cœur
  • 37,241
  • 25
  • 195
  • 267
igor
  • 37
  • 1
  • 8
  • http://stackoverflow.com/questions/10515808/django-mysql-no-such-table-aidata-django-session – chandu Jun 09 '15 at 12:53
  • Django>=1.8. @chadu I did all from that tut but it is not working. – igor Jun 09 '15 at 13:24
  • did you used migration? – chandu Jun 09 '15 at 13:51
  • Yes, i do. Migrations works with no errors but when i run server getting exception. – igor Jun 09 '15 at 13:54
  • SessionMiddleware is uncommented. What to disable ? – igor Jun 09 '15 at 14:00
  • show the settings.py file – chandu Jun 09 '15 at 14:00
  • MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', ) – igor Jun 09 '15 at 14:07
  • If you don’t want to use sessions, you might as well comment the SessionMiddleware line from MIDDLEWARE_CLASSES and 'django.contrib.sessions' from your INSTALLED_APPS. – chandu Jun 09 '15 at 14:07
  • Read this http://stackoverflow.com/questions/27180353/django-project-looking-for-attribute-session-cache – chandu Jun 09 '15 at 14:09
  • I am using SessionMiddleware but i want from django to create needed tables. – igor Jun 09 '15 at 14:18

0 Answers0