Jump to content

Recommended Posts

Posted

I am trying to create a webapp where person can store some data(email and password) but i want to use .txt file while storing their data.Mean i want to store their data into the .txt file but if i try to use with statement in my myapp.py then it gives the internal server error.
I am using Flask to create this webapp.

 

Posted

Why not store data in a database?

 

If you insist on writing to a file for some reason, I would bet the reason it is failing is permissions.

Posted (edited)

Why not store data in a database?

 

If you insist on writing to a file for some reason, I would bet the reason it is failing is permissions.

How is it is to store that much simple data in database then in .txt file?

I think storing this simple data in data base is very hard then store that in just .txt file?

Don't you think so.

And Can i install some needed package like as pickle?

To save that data in .txt file.

Edited by xitiz
Posted

Yes, I would definitely use a database to store emails and passwords for people. Make sure you don't store the passwords in plaintext either. They need to be salted and hashed. Storing emails and passwords in a text file is probably one of the worst ideas I've heard in a long time. What if someone figures out the name of the text file and just goes to yourdomain.heliohost.org/passwords.txt and everything is displayed? It may take a tiny bit more work now to figure out how to use a database and everything, but it will pay off in the long run. Develop good habits today, and you won't end up with a disaster later on.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...