Python 在sqlite总线中运行良好,因为我更改为postgresql,在/relation";主应用程序“邮政”;不存在
我最近切换到了postgresql,我最终没有在终端中得到任何错误,我认为所有的事情都已经设置好了。但在浏览器中,我又犯了这个错误Python 在sqlite总线中运行良好,因为我更改为postgresql,在/relation";主应用程序“邮政”;不存在,python,django,postgresql,Python,Django,Postgresql,我最近切换到了postgresql,我最终没有在终端中得到任何错误,我认为所有的事情都已经设置好了。但在浏览器中,我又犯了这个错误 ProgrammingError at / relation "main_post" does not exist LINE 1: ..."main_post"."image", "main_post"."thumbnail" FROM "main_post... 它在sqlite3中工作得很好,不知道为什么会出现这个错误。 这是回溯,有人能帮我找一下这个错误吗
ProgrammingError at /
relation "main_post" does not exist
LINE 1: ..."main_post"."image", "main_post"."thumbnail" FROM "main_post...
它在sqlite3中工作得很好,不知道为什么会出现这个错误。
这是回溯,有人能帮我找一下这个错误吗
Traceback:
File "/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/ebagu/main/views.py" in index
63. post_list = sorted(post_list, key=lambda x: x.get_score(), reverse=True)
File "/env/local/lib/python2.7/site-packages/django/db/models/query.py" in __iter__
162. self._fetch_all()
File "/env/local/lib/python2.7/site-packages/django/db/models/query.py" in _fetch_all
965. self._result_cache = list(self.iterator())
File "/env/local/lib/python2.7/site-packages/django/db/models/query.py" in iterator
238. results = compiler.execute_sql()
File "/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
840. cursor.execute(sql, params)
File "/env/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
79. return super(CursorDebugWrapper, self).execute(sql, params)
File "/env/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
64. return self.cursor.execute(sql, params)
File "/env/local/lib/python2.7/site-packages/django/db/utils.py" in __exit__
97. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/env/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
64. return self.cursor.execute(sql, params)
Exception Type: ProgrammingError at /
Exception Value: relation "main_post" does not exist
LINE 1: ..."main_post"."image", "main_post"."thumbnail" FROM "main_post...
^
你运行过python manage.py migrate吗?@DerekKwok当然,makemigrations,migrate,syncdb是我首先要做的事情did@winixxee检查drop db并重试的最佳方法…@RajaSimon我如何删除bdb?您是否尝试过
python manage.py makemigrations myapp
,然后python manage.py migrate myapp
?您是否运行过python manage.py migrate
?@derekwok当然,makemigrations,migrate,syncdb是我首先要做的事情did@winixxee检查drop db并重试的最佳方法…@RajaSimon我如何删除bdb?您是否尝试过python manage.py makemigrations myapp
然后python manage.py migrate myapp
?