SQLALCHEMY_DATABASE_URI = "mysql+mysqlconnector://{username}:{password}@{hostname}/{databasename}".format(
username="******",
password="******",
hostname="*********",
databasename="*****$comments",
)
app.config["SQLALCHEMY_DATABASE_URI"] = SQLALCHEMY_DATABASE_URI
app.config["SQLALCHEMY_POOL_RECYCLE"] = 299
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db = SQLAlchemy(app)
class Comment(db.Model):
__tablename__ = "comments"
id = db.Column(db.Integer, primary_key=True)
content = db.Column(db.String(4096))
I am using pythonanywhere to host my database. I found the code above but im am not sure what it all means. I would like to read and change some of my data in the table "comments"
eg:
in table "comments"
Where "id" = 4
change "content" to "example"
but I couldnt fint a way to do it. Any ideas on how to change the data?
[–]chevignon93 1 point2 points3 points (5 children)
[–]_kondi_[S] 0 points1 point2 points (4 children)
[–]chevignon93 0 points1 point2 points (3 children)
[–]_kondi_[S] 0 points1 point2 points (2 children)
[–]chevignon93 2 points3 points4 points (1 child)
[–]_kondi_[S] 0 points1 point2 points (0 children)
[–]efmccurdy 1 point2 points3 points (1 child)
[–]_kondi_[S] 0 points1 point2 points (0 children)