Can someone help me make my Python Chat safer?
many people think that a txt file is bad, so does anyone have an idea on how to use something else? (idk socket)
instead of using a file, use replit db, it's like a dict.
from replit import db - Official way, has a dependency with an old version of Flask. I recommend this if you don't need flask
from replitapi import db - Way I created that behaves exactly the same but doesn't depend on old Flask. You may need to install
replitapi via the packages tab.
use the db like this:
db["hello"] = "world" print(db["hello"]) # world
it auto saves and also is private, so that there is not an everlasting message log that anyone can access.
why not make a main flask server for the chat client and hold the chat data as a string instead of a file?