Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Google应用程序引擎错误:uu init_uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu;要求';_Python_Python 2.7_Google App Engine - Fatal编程技术网

Python Google应用程序引擎错误:uu init_uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu;要求';

Python Google应用程序引擎错误:uu init_uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu;要求';,python,python-2.7,google-app-engine,Python,Python 2.7,Google App Engine,我正在做一个关于谷歌应用程序引擎的教程,我发现了这个错误: ERROR 2016-08-27 17:41:18,545 webapp2.py:1552] __init__() got an unexpected keyword argument 'require' 我不知道这是什么要求,也不知道这意味着什么。请建议。谢谢 我打电话时会发生这种情况: 控制器: json_response = Users.add_new_user(name, email, password) 型号: cl

我正在做一个关于谷歌应用程序引擎的教程,我发现了这个错误:

ERROR    2016-08-27 17:41:18,545 webapp2.py:1552] __init__() got an unexpected keyword argument 'require'
我不知道这是什么要求,也不知道这意味着什么。请建议。谢谢

我打电话时会发生这种情况:

控制器:

json_response = Users.add_new_user(name, email, password)
型号:

class Users(db.Model):
    name = db.StringProperty(required = True)
    email = db.StringProperty(required = True)
    password = db.StringProperty(require = True)
    confirmation_code = db.StringProperty(required = True)
    confirmed_email = db.BooleanProperty(default = False)

    @classmethod
    def check_if_exists(cls, email):
        return cls.query(cls.email == email).get()

    @classmethod
    def add_new_user(cls, name, email, password):
        user = cls.check_if_exists(email)

        if not user:
            random_bytes = urandom(64)
            salt = b64encode(random_bytes).decode('utf-8')
            hashed_password = salt + sha256(salt + password).hexdigest()

            confirmation_code = str(uuid.uuid4().get_hex())

            new_user_key = cls(
                name=name,
                email=email,
                password=hashed_password,
                confirmation_code=confirmation_code
            ).put()

            print(new_user_key)


            return {
                'created': True,
                'user_id': new_user_key.id(),
                'confirmation_code':confirmation_code
            }

        else:
            return {
                'created': False,
                'title': 'This email is already in use',
                'message': 'Please log in if this is your email account. '
            }

您有一个输入错误:
require
而不是
required

    password = db.StringProperty(require = True)

您有一个输入错误:
require
而不是
required

    password = db.StringProperty(require = True)

请添加堆栈跟踪请添加堆栈跟踪日志非常好。如错误中所述快速搜索
require
将显示该行。日志非常好。如错误中所述快速搜索
require
将显示该行。