1

I've noticed an error that pops up whenever I try to register a new user in cs50 finance. I've first noticed this today - I've never this problem before, and I've used the registration many times. Here's the error:

DeprecationWarning: the method passlib.context.CryptContext.encrypt() is 
deprecated as of Passlib 1.7, and will be removed in Passlib 2.0, use 
CryptContext.hash() instead.

I'm not sure why this is...the specification of register says to use pwd_context.encrypt...Anyway, apart from just bringing this to attention, I'd also like to know how to work around it. I can't make heads or tails out of how to use CryptContext.hash(), so if someone could help me with that, it would be greatly appreciated. Thanks in advance.

6

Use hash instead of encrypt in your register function. I tried it, it worked for me. I was able to sign on as an existing user, or register (and sign on as) a new user. I am not advocating blindly using functions without reading and understanding the doc. Except maybe on a beautiful, sunny, lazy, Sunday afternoon :)

| improve this answer | |
  • Thanks, it works! Enjoy the rest of your Sunday afternoon :) – Jason_V Jul 17 '17 at 1:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .