zoukankan      html  css  js  c++  java
  • Debug

    Traceback (most recent call last):
    File "C:Program Files (x86)JetBrainsPyCharm Community Edition 4.5.2helperspydevpydevd.py", line 2357, in
    globals = debugger.run(setup['file'], None, None, is_module)
    File "C:Program Files (x86)JetBrainsPyCharm Community Edition 4.5.2helperspydevpydevd.py", line 1777, in run
    pydev_imports.execfile(file, globals, locals) # execute the script
    File "C:/Users/Liu_100/PycharmProjects/flask/flaskr/manage.py", line 13, in
    app = create_app(os.getenv('FLASK_CONFIG') or 'default')
    File "C:/Users/Liu_100/PycharmProjects/flask/flaskrapp_init__.py", line 43, in createapp
    app.register_blueprint(api_1_0_blueprint, url_prefix='/api/v1.0')
    File "C:UsersLiu_100AppDataRoamingPythonPython27site-packagesflaskapp.py", line 65, in wrapper_func
    return f(self, *args, **kwargs)
    File "C:UsersLiu_100AppDataRoamingPythonPython27site-packagesflaskapp.py", line 968, in register_blueprint
    blueprint.register(self, options, first_registration)
    File "C:UsersLiu_100AppDataRoamingPythonPython27site-packagesflasklueprints.py", line 154, in register
    deferred(state)
    File "C:UsersLiu_100AppDataRoamingPythonPython27site-packagesflasklueprints.py", line 129, in wrapper
    func(state)
    File "C:UsersLiu_100AppDataRoamingPythonPython27site-packagesflasklueprints.py", line 400, in
    self.name, code_or_exception, f))
    File "C:UsersLiu_100AppDataRoamingPythonPython27site-packagesflaskapp.py", line 65, in wrapper_func
    return f(self, *args, **kwargs)
    File "C:UsersLiu_100AppDataRoamingPythonPython27site-packagesflaskapp.py", line 1201, in registererror_handler
    exc_class, code = self.getexc_class_and_code(code_or_exception)
    File "C:UsersLiu_100AppDataRoamingPythonPython27site-packagesflaskapp.py", line 1125, in getexc_class_and_code
    assert issubclass(exc_class, Exception)
    TypeError: issubclass() arg 1 must be a class

    问题出在createapp里app.register_blueprint

    api = Blueprint('api', __name__)
    from . import authentication, posts, users, comments, errors


    在.errors里调用了一个exception.py里的ValidationError,错误声明为了def(应该是class)
    api.errorhandler(ValidationError)
    def validation_error(e):
    return bad_request(e.args[0])

    )

  • 相关阅读:
    michael的沟通秘籍
    panels能否包含views_block ////// panels -- content pane 参数传递
    Unity动画
    DoTween动画插件学习
    C#委托的进一步学习
    阶段学习总结-坦克大战(2D)案例
    学习总结
    阶段学习总结-见缝插针案例
    阶段学习总结-坦克大战案例
    碰撞检测和触发检测
  • 原文地址:https://www.cnblogs.com/autoria/p/6158687.html
Copyright © 2011-2022 走看看