from flask import (Flask, render_template) from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://userassword@localhost/database' db = SQLAlchemy(app) class User(db.Model): id = db.Column(db.Integer, primary_key=True) nickname = db.Column(db.String(80), unique=True) def __init__(self, id, nickname): self.id = id self.nickname = nickname admin = User('admin') This code throws TypeError: __init__() missing 1 required positional argument: 'nickname', so it seems like it expects me to manually set the id, though i probably shouldn't do it? I also tried executing User(nickname='admin'), but it doesn't seem to work. Thanks for the help Continue reading...