2010-02-06 97 views
0

看看到底線:ProgrammingError:(1146,「表‘test.sphinx_test_file’不存在」)哪裏定義了表'test.sphinx_test_file'?

Traceback (most recent call last): 

    File "D:\Python25\Lib\site-packages\django\core\servers\basehttp.py", line 280, in run 
    self.finish_response() 

    File "D:\Python25\Lib\site-packages\django\core\servers\basehttp.py", line 319, in finish_response 
    for data in self.result: 

    File "D:\Python25\Lib\site-packages\django\http\__init__.py", line 374, in __iter__ 
    self._iterator = iter(self._container) 

    File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 240, in __iter__ 
    return iter(self._get_data()) 

    File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 404, in _get_data 
    self._result_cache = list(self._get_results()) 

    File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 570, in _get_results 
    queryset = dict([(', '.join([unicode(getattr(o, p.attname)) for p in pks]), o) for o in queryset]) 

    File "D:\Python25\Lib\site-packages\django\db\models\query.py", line 106, in _result_iter 
    self._fill_cache() 

    File "D:\Python25\Lib\site-packages\django\db\models\query.py", line 692, in _fill_cache 
    self._result_cache.append(self._iter.next()) 

    File "D:\Python25\Lib\site-packages\django\db\models\query.py", line 238, in iterator 
    for row in self.query.results_iter(): 

    File "D:\Python25\Lib\site-packages\django\db\models\sql\query.py", line 287, in results_iter 
    for rows in self.execute_sql(MULTI): 

    File "D:\Python25\Lib\site-packages\django\db\models\sql\query.py", line 2369, in execute_sql 
    cursor.execute(sql, params) 

    File "D:\Python25\Lib\site-packages\django\db\backends\util.py", line 19, in execute 
    return self.cursor.execute(sql, params) 

    File "D:\Python25\Lib\site-packages\django\db\backends\mysql\base.py", line 84, in execute 
    return self.cursor.execute(query, args) 

    File "D:\Python25\Lib\site-packages\MySQLdb\cursors.py", line 163, in execute 
    self.errorhandler(self, exc, value) 

    File "D:\Python25\Lib\site-packages\MySQLdb\connections.py", line 35, in defaulterrorhandler 
    raise errorclass, errorvalue 

ProgrammingError: (1146, "Table 'test.sphinx_test_file' doesn't exist") 

回答

0

你運行syncdb添加應用程序(我猜的應用程序被命名爲sphinx後)到你的settings.py?

+0

是的,它被命名爲sphinx,但我已經'python manage.py syncdb'已經 – zjm1126 2010-02-06 07:47:36

+0

你進入MySQL shell並檢查表是否真的存在?如果它在那裏,我的下一步就是運行'python manage.py reset sphinx'(注意 - 這將丟棄存儲在由'sphinx'應用程序定義的模型中的所有數據)。 – 2010-02-06 11:20:38