chamkank / flask-chatterbot

Simple boilerplate for ChatterBot using Flask
377 stars 263 forks source link

column text is not unique #6

Closed edwardinubuntu closed 7 years ago

edwardinubuntu commented 7 years ago

I deployed to heroku with Procfile:

web:gunicorn app:chamkank

And just change this example from app.py to chamkank.py

After build success, start to launch gunicorn got following issues.

sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) column text is not unique [SQL: 'INSERT INTO "StatementTable" (text, extra_data) VALUES (?, ?)'] [parameters: ('Artificial Intelligence is the branch of engineering and science devoted to constructing machines that think.', <memory at 0x7f30d0599048>)]

edwardinubuntu commented 7 years ago

I think it's sql adapter problem with gnicorn, in my localhost it doing great. And after I change adapter from sqlite to mogodb: storage_adapter='chatterbot.storage.MongoDatabaseAdapter' all work fine on heroku.

chamkank commented 7 years ago

Thanks for reporting this, from this article it seems that Heroku doesn't support SQLite because of their file system, but does support PostgreSQL.

I'm glad MongoDB works for you, I'll make a note in the README to switch to use the MongoDatabaseAdapter if deploying to Heroku (since SQLite works fine on other hosts like AWS and PythonAnywhere).

chamkank commented 7 years ago

Done, see README. Thanks again, let me know if there's anything else you have trouble with on Heroku.

edwardinubuntu commented 7 years ago

Thank you so much.