Python Forum
sqlite objects in thread can only be used in the same thread
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sqlite objects in thread can only be used in the same thread
#6
(Oct-24-2019, 05:08 AM)snippsat Wrote:
(Oct-24-2019, 03:51 AM)darktitan Wrote: My app.py looks like this
Then you don't need db_setup.py at all,it's maybe confusing because he mixing this stuff together in tutorial.
He do mention this.
Mike Driscoll Wrote:You will note that Flask-SQLAlchemy doesn’t require all the imports that just plain SQLAlchemy required.
All we need is the db object we created in our app script.

Nice to know. I did the modification needed and removed SQLAlchemy but im still got same problem as before. I cant save the changes i do to the account. and im not getting any error on my stationary computer. In console i can see the POST but nothing more. And when i enter the db file nothing have changed. Funny thing is i use almost the identical code in another thing in an another table in the db and it works the changes gets saved and i get redirected to another page.

eureka

I hade put FlaskForm instead of Form In my Form for the page

class UserForm(Form):
    user = StringField('Användarnamn:', validators=[DataRequired()])
    password = StringField('Lösenord:', validators=[DataRequired()])
    urole = StringField('Användar Behörighet:', validators=[DataRequired()])
    owner = StringField('Användar namn:', validators=[DataRequired()])
       
Got it to work now.
Reply


Messages In This Thread
RE: sqlite objects in thread can only be used in the same thread - by darktitan - Oct-24-2019, 05:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  new window in separate thread - flask website Notabene 3 3,477 Sep-20-2021, 08:29 AM
Last Post: jamesaarr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020