我将我的django项目部署在 heroku 上,并且数据库位于 postgresql 上,但是,当我在heroku上打开应用程序时,并没有显示特定的模板称为“ products.html”。因此,我检查了日志,并向我显示了psycopg2的错误以及与该模板关联的模型和视图的关系。
我在本地进行迁移/迁移,更新了git repo,推送到heroku并在heroku上迁移,但是这些都不起作用。
此外,当我运行heroku运行manage.py migrate时,它告诉我没有要应用的迁移。
No migrations to apply 有人可以建议我吗?
2019-03-21T22:43:30.822852+00:00 app[web.1]: 10.51.203.60 - - [21/Mar/2019:22:43:30 +0000] "GET / HTTP/1.1" 404 77 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
2019-03-21T22:43:39.202942+00:00 app[web.1]: Internal Server Error: /petit/productos
2019-03-21T22:43:39.202960+00:00 app[web.1]: Traceback (most recent call last):
2019-03-21T22:43:39.202963+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
2019-03-21T22:43:39.202964+00:00 app[web.1]: return self.cursor.execute(sql, params)
2019-03-21T22:43:39.202966+00:00 app[web.1]: psycopg2.ProgrammingError: relation "product" does not exist
2019-03-21T22:43:39.202968+00:00 app[web.1]: LINE 1: ..."product"."k_idcommerce", "product"."v_price" FROM "product"
2019-03-21T22:43:39.202969+00:00 app[web.1]: ^
2019-03-21T22:43:39.202971+00:00 app[web.1]:
2019-03-21T22:43:39.202972+00:00 app[web.1]:
2019-03-21T22:43:39.202973+00:00 app[web.1]: The above exception was the direct cause of the following exception:
2019-03-21T22:43:39.202974+00:00 app[web.1]:
2019-03-21T22:43:39.202976+00:00 app[web.1]: Traceback (most recent call last):
2019-03-21T22:43:39.202977+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
2019-03-21T22:43:39.202978+00:00 app[web.1]: response = get_response(request)
2019-03-21T22:43:39.202979+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response ```