Ask coding questions

← Back to all posts
How do I make this work how I want it?
MisledWater79

I am trying to make a login thing in python and I'm using json to store the logins and passwords(I know not the best way to store it safely) and I cant get it to work, It changes the file but doesnt add the new user to it. Thanks in advance!

Answered by OldWizard209 [earned 5 cycles]
View Answer
Voters
MisledWater79
Comments
hotnewtop
OldWizard209

Nope, you shouldn't be using .json or.txt. It is the worst way to save data. You should use a database. As you are on replit, use their database. It is very simple and uses key-value pairs. To create a password and username into the database use this code:

If you want to get the username and pas from users:

NEVER save data in a json file. One command in the shell and bai bai to all your data. Hope I helped.

MisledWater79

@OldWizard209 Where can I learn more on repels database?

Flyingcrabs
MisledWater79

@Flyingcrabs Thanks!

Flyingcrabs

Np you can get it in the side bar of your repl hit the coins thing and on top there is a blue database click it and you can get this doc @MisledWater79

Flyingcrabs

Hehe love your password 5678 and username dav
repl keeps it private but still i know how to steal the key a value

MisledWater79

@Flyingcrabs tbh I thought i had it as dave but i guess not lol

Flyingcrabs

Never ever use json file repl is good and it is also easy to learn