Django 可疑操作请求会话已删除
Django Suspicious Operation Request Session deleted
我尝试在我的服务器上获取我的 django 页面 运行,但在我的浏览器中偶然发现以下错误消息:
SuspiciousOperation at /lfp/filter/
The request's session was deleted before the request completed. The
user may have logged out in a concurrent request, for example.
您可以在此处找到回溯:
Environment:
Request Method: GET
Request URL: http://localhost/pass/lfp/filter/
Django Version: 1.11.2
Python Version: 3.6.1
Installed Applications:
['django_tables2',
'pass_list.apps.PassListConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py" in execute
328. return Database.Cursor.execute(self, query, params)
The above exception (attempt to write a readonly database) was the direct cause of the following exception:
File "/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py" in save
87. obj.save(force_insert=must_create, force_update=not must_create, using=using)
File "/lib/python3.6/site-packages/django/db/models/base.py" in save
806. force_update=force_update, update_fields=update_fields)
File "/lib/python3.6/site-packages/django/db/models/base.py" in save_base
836. updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/lib/python3.6/site-packages/django/db/models/base.py" in _save_table
903. forced_update)
File "/lib/python3.6/site-packages/django/db/models/base.py" in _do_update
953. return filtered._update(values) > 0
File "/lib/python3.6/site-packages/django/db/models/query.py" in _update
664. return query.get_compiler(self.db).execute_sql(CURSOR)
File "/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
1191. cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
886. raise original_exception
File "/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
876. cursor.execute(sql, params)
File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
80. return super(CursorDebugWrapper, self).execute(sql, params)
File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/lib/python3.6/site-packages/django/db/utils.py" in __exit__
94. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/lib/python3.6/site-packages/django/utils/six.py" in reraise
685. raise value.with_traceback(tb)
File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py" in execute
328. return Database.Cursor.execute(self, query, params)
During handling of the above exception (attempt to write a readonly database), another exception occurred:
File "/lib/python3.6/site-packages/django/contrib/sessions/middleware.py" in process_response
58. request.session.save()
File "/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py" in save
94. raise UpdateError
During handling of the above exception (), another exception occurred:
File "/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)
File "/lib/python3.6/site-packages/django/utils/deprecation.py" in __call__
142. response = self.process_response(request, response)
File "/lib/python3.6/site-packages/django/contrib/sessions/middleware.py" in process_response
61. "The request's session was deleted before the "
Exception Type: SuspiciousOperation at /lfp/filter/
Exception Value: The request's session was deleted before the request completed. The user may have logged out in a concurrent request, for example.
我该如何解决这个问题?
我解决了我的问题。这是访问管理的问题。文件 db.sqlite3 只是可读的。更改权限解决了我的问题。
我尝试在我的服务器上获取我的 django 页面 运行,但在我的浏览器中偶然发现以下错误消息:
SuspiciousOperation at /lfp/filter/
The request's session was deleted before the request completed. The user may have logged out in a concurrent request, for example.
您可以在此处找到回溯:
Environment:
Request Method: GET
Request URL: http://localhost/pass/lfp/filter/
Django Version: 1.11.2
Python Version: 3.6.1
Installed Applications:
['django_tables2',
'pass_list.apps.PassListConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py" in execute
328. return Database.Cursor.execute(self, query, params)
The above exception (attempt to write a readonly database) was the direct cause of the following exception:
File "/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py" in save
87. obj.save(force_insert=must_create, force_update=not must_create, using=using)
File "/lib/python3.6/site-packages/django/db/models/base.py" in save
806. force_update=force_update, update_fields=update_fields)
File "/lib/python3.6/site-packages/django/db/models/base.py" in save_base
836. updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/lib/python3.6/site-packages/django/db/models/base.py" in _save_table
903. forced_update)
File "/lib/python3.6/site-packages/django/db/models/base.py" in _do_update
953. return filtered._update(values) > 0
File "/lib/python3.6/site-packages/django/db/models/query.py" in _update
664. return query.get_compiler(self.db).execute_sql(CURSOR)
File "/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
1191. cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
886. raise original_exception
File "/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
876. cursor.execute(sql, params)
File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
80. return super(CursorDebugWrapper, self).execute(sql, params)
File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/lib/python3.6/site-packages/django/db/utils.py" in __exit__
94. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/lib/python3.6/site-packages/django/utils/six.py" in reraise
685. raise value.with_traceback(tb)
File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py" in execute
328. return Database.Cursor.execute(self, query, params)
During handling of the above exception (attempt to write a readonly database), another exception occurred:
File "/lib/python3.6/site-packages/django/contrib/sessions/middleware.py" in process_response
58. request.session.save()
File "/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py" in save
94. raise UpdateError
During handling of the above exception (), another exception occurred:
File "/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)
File "/lib/python3.6/site-packages/django/utils/deprecation.py" in __call__
142. response = self.process_response(request, response)
File "/lib/python3.6/site-packages/django/contrib/sessions/middleware.py" in process_response
61. "The request's session was deleted before the "
Exception Type: SuspiciousOperation at /lfp/filter/
Exception Value: The request's session was deleted before the request completed. The user may have logged out in a concurrent request, for example.
我该如何解决这个问题?
我解决了我的问题。这是访问管理的问题。文件 db.sqlite3 只是可读的。更改权限解决了我的问题。