You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I am newish to Python, Mongoengine, and web development in general, so if this can already be done rather easily, then I'd appreciate the help.
Like most, I have a User model with username and password fields, currently both StringFields. I want to salt/hash my passwords as they go in the database, and as far as I can tell, the only way I can do that currently is by calling some function in the controller portion of my web app to hash/salt my password before it gets put into the database. Which can work fine as long as I remember to do so.
But if I want to access my DB via the shell, and add in a few test Users, or perform some administrative work on that end? If I try to use User.create(), I will likely forget to add the hashing to the password, and then I'll likely need to go back in and change that later.
It would be nice if there was a PasswordField(), or at least parameter on StringField where I can provide a setter function for that field, so I know for certain every time that the field will be hashed/salted.
The text was updated successfully, but these errors were encountered:
So I am newish to Python, Mongoengine, and web development in general, so if this can already be done rather easily, then I'd appreciate the help.
Like most, I have a User model with username and password fields, currently both StringFields. I want to salt/hash my passwords as they go in the database, and as far as I can tell, the only way I can do that currently is by calling some function in the controller portion of my web app to hash/salt my password before it gets put into the database. Which can work fine as long as I remember to do so.
But if I want to access my DB via the shell, and add in a few test Users, or perform some administrative work on that end? If I try to use
User.create()
, I will likely forget to add the hashing to the password, and then I'll likely need to go back in and change that later.It would be nice if there was a PasswordField(), or at least parameter on StringField where I can provide a setter function for that field, so I know for certain every time that the field will be hashed/salted.
The text was updated successfully, but these errors were encountered: