Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python - pasword hashed

from werkzeug.security import generate_password_hash, check_password_hash


# Entidad Usuario (user)
class User():

    # Metodo Constructor (de la clase) __init__
    # Reflejo de la Tabla users que tenemos en la BD MySQL
    # manejar la entidades tipo usuario y autentificacion
    def __init__(self, id, email, password) -> None:
        self.id = id
        self.email = email
        self.password = password

    # class Metodo para validar el usuario
    # hashed_password es la pass hasheada (proceso hash)
    # y guardada en la BD MySQL
    # password el la pass en texto plano sin encriptar
    # @classmethod permite usar el metodo como una funcion
    # SIN TENER QUE INSTANCIAR la clase
    @classmethod
    def check_password(self, hashed_password, password):
        return check_password_hash(hashed_password, password)
Comment

PREVIOUS NEXT
Code Example
Python :: django q and f 
Python :: Python DateTime Time Class syntax 
Python :: json to csv python github 
Python :: pypi cryptography 
Python :: In addition to indexing, slicing is also supported. While indexing is used to obtain individual characters, slicing allows you to obtain substring: 
Python :: disable kivy button in kv 
Python :: line of best fit in linear regression 
Python :: how to save a from with createvue django 
Python :: how to add field to django forms createview 
Python :: pypy stragger 
Python :: numpy topk 
Python :: python lister éléments enum 
Python :: how to use the "import random" in-built model in python 
Python :: iterate over k values and plot the inertia values for each k 
Python :: flask how to initialze extension after start 
Python :: Python Code for Checking if a number is an Odd number 
Python :: simulieren mit python 
Python :: Como hacer mayusculas un string 
Python :: Filling or replacing the missing values with mode 
Python :: create list python 
Python :: insert key in binary tree recursively 
Python :: expected str instance, NoneType found 
Python :: theano_flags windows 
Python :: pd.read_csv how to cumsum a column 
Python :: re.add python 
Python :: python change type of every element in a dictionary 
Python :: python output parameter 
Python :: 2d grid python pygame 
Python :: ModelCheckpoint 
Python :: Return the number of elements in this RDD. 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =