This might be a bit hard for a beginner (you would need at least a bit of a high-level understanding of SQL, Flask, and SQLAlchemy) but there are very few files and if you read carefully you will manage. Take a look at: https://github.com/RafaelMiquelino/dash-flask-login
A bit more complex version of that is what I’m using for my app. It would be best if you didn’t store passwords but hashes, e.g.:
hashed = hash("my_password")
users_dict["awesome_user"] = hashed
If you don’t want to use SQL, CSV and JSON are both fine, but using hashes is the important part. Then, if you want to log a user in, you just do the same thing:
hashed = hash("my_password")
if hashes == users_dict["awesome_user"]:
login(...)
Now, for addressing the “different users get different data” part, I’d just save them as lists in a dictionary (or similar) like the following:
user1 = "myself"
user2 = "you"
data1 = "data1.csv"
data2 = "data2.csv"
data3 = "data3.csv"
data_dict[user1] = [data1, ] # only has access to dataset 1
data_dict[user2] = [data2, data3] # super user, has access to 2 datasets
or maybe you can directly save the data with composite keys:
data_dict[(user1, "data1.csv")] = pd.DataFrame([1,2,3])
data_dict[(user2, "data2.csv")] = pd.DataFrame([99,2,4])
data_dict[(user2, "data3.csv")] = pd.DataFrame([3,7,4])
If you only have a user, you can iterate over data_dict.keys()
.
Good luck 