Django Authentication, should frontend connect to remote database using API or SSH key?

I'm new to backend and now in my backend, I have a database and server connecting, I'm trying to build a login and registration function. And in my frontend, I'm not connecting to my database directly.

My question is, should I connect to my database using my ssh key so that I can register a user directly on my frontend? Or should I just post my username and password to the backend using my API? But for this approach, how to encode the password and save it to the user authentication table?

Or both of my ideas above are not appropriate? Normally, what would developers do to register and login a user when having a remote server and database?

Any idea would be appriciated. Thanks for your help!

Kind regards,

Xi

Back to Top