Merge pull request 'fix: with app.app_context()' (#1) from PeterSurda/inoreader2readwise:feature/separate-services into feature/separate-services

Reviewed-on: #1
This commit is contained in:
swapnil 2024-01-24 12:18:24 +00:00
commit fec1929d72
1 changed files with 3 additions and 2 deletions

View File

@ -17,8 +17,9 @@ class Token(db.Model):
def __repr__(self):
return f'<Token {self.id}>'
# Initialize the database
db.create_all()
# Create an application context
with app.app_context():
db.create_all()
# API to create a new token entry
@app.route('/token', methods=['POST'])