So I know this problem is not new in flask, and people have already asked it before. However I am still facing a problem while executing my database commands in bash as I am new to python. This is what i did
import sqlite3
conn = sqlite.connect('/home/pjbardolia/mysite/tweet_count.db')
c = conn.cursor()
c.execute("create table count_twitter (count_id integer primary key autoincrement ,count_present integer not null,last_tweet not null)")
c.execute(insert into count_twitter values('',10,10))
however after executing insert statement I am getting operational error: database is locked. Can someone tellme in simple terms what does this error means? and how to solve it. Thanks in advance
c.execute("insert into count_twitter values('',10,10)")? The SQLite doc page for that error gives plenty of guidance. One thing to watch in Flask is going from dev mode (using "app.run()") to production mode (in a WSGI server) you are moving from single to multiple threads which might cause problems with SQLite and require extra concurrency handling. - allen-smithee