这里要疯了。
所以这里是回溯:
Traceback (most recent call last):
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/contrib/admin/options.py", line 366, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/views/decorators/cache.py", line 89, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/contrib/admin/sites.py", line 196, in inner
return view(request, *args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/utils/decorators.py", line 25, in _wrapper
return bound_func(*args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/utils/decorators.py", line 21, in bound_func
return func(self, *args2, **kwargs2)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/transaction.py", line 224, in inner
return func(*args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/contrib/admin/options.py", line 1274, in delete_view
[obj], opts, request.user, self.admin_site, using)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/contrib/admin/util.py", line 104, in get_deleted_objects
collector.collect(objs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/contrib/admin/util.py", line 155, in collect
return super(NestedObjects, self).collect(objs, source_attr=source_attr, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/deletion.py", line 175, in collect
if not sub_objs:
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/query.py", line 130, in __nonzero__
iter(self).next()
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/query.py", line 118, in _result_iter
self._fill_cache()
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/query.py", line 892, in _fill_cache
self._result_cache.append(self._iter.next())
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/query.py", line 291, in iterator
for row in compiler.results_iter():
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter
for rows in self.execute_sql(MULTI):
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
cursor.execute(sql, params)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/backends/sqlite3/base.py", line 344, in execute
return Database.Cursor.execute(self, query, params)
DatabaseError: no such table: orders_orderline
奇怪的是,这只显示在管理视图上,即:
http://www.myrandomsite.gr/admin/store/product/138/delete/
如果我从 ./manage.py shell 启动 shell,我可以在对象上调用 .delete() 就好了。
另一个奇怪的事情是,它在我的本地机器上运行良好。它只发生在 apache 部署中。我还有几个网站使用相同的东西并且工作得很好。
我正在镜像应用程序、python 版本和数据库。我尝试重新创建所有内容,virtualenv,db 等。
尝试到处确认以查看该 orders_orderline 的定义位置。它只是我项目中的另一个应用程序,没有在 INSTALLED_APPS 或任何地方设置。我只在特定视图(模型 OrderLine)中使用它,只有在安装了应用程序时才会导入。
编辑:我 sqlite3 mydb 我也找不到对该表的任何引用,因为它首先不应该存在,管理员在哪里捡起它?
编辑2:只有当我设置 DEBUG, TEMPLATE_DEBUG = FALSE 时才会发生这种情况