Django project looking for “attribute '_session_cache'”

前端 未结 4 790
暗喜
暗喜 2020-12-20 14:58

So I have a Django project that doesn\'t use a database (the \'DATABASES\' setting is commented out). I chose to use Django as there\'s a chance I will need the database fun

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-20 15:33

    The error AttributeError: 'SessionStore' object has no attribute '_session_cache' can stem from the database not having a django_session table. However, since you are not using a table, you would need to make sure that you don't have the 'django.contrib.sessions.middleware.SessionMiddleware' in your MIDDLEWARE_CLASSES in the project's settings file. If it is in there, it will look for a database table which stores the sessions, causing the above error.

提交回复
热议问题