简体   繁体   English

Chatterbot Django和Heroku(问题正在运行的示例)

[英]Chatterbot Django and Heroku (Issues Running Example)

I've had a couple of issues now and I've nearly got the Chatterbot example working for Django running on Heroku. 我现在遇到了几个问题,并且几乎可以使用Chatterbot示例来在Heroku上运行Django。

Here is my example page. 这是我的示例页面。 https://polar-basin-92507.herokuapp.com/ https://polar-basin-92507.herokuapp.com/

looking at the log the issue seems to be 看日志似乎是问题所在

OperationalError: no such table: django_chatterbot_statement OperationalError:没有这样的表:django_chatterbot_statement

Full log https://hastebin.com/mucanobuki.sql 完整日志https://hastebin.com/mucanobuki.sql

git source https://github.com/gunthercox/ChatterBot/tree/master/examples/django_app/example_app git源https://github.com/gunthercox/ChatterBot/tree/master/examples/django_app/example_app

From what I can tell their example was setup to use sqlite3 but heroku doesn't support that and that I need to somehow switch it over to postgres? 据我所知,他们的示例设置为使用sqlite3,但heroku不支持该示例,我需要以某种方式将其切换到postgres? Not sure and this is where I'd like some guidance. 不确定,这是我想要的指导。

You need to setup Postgresql in heroku. 您需要在heroku中设置Postgresql。 Just add these lines in your settings.py file found here 只需将这些行添加到此处的 settings.py文件中

import dj_database_url
db_from_env = dj_database_url.config()
DATABASES['default'].update(db_from_env)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM