• 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])

    )

  • 相关阅读:
    archlinux 怎么样安装KDE界面
    选择Arch Linux还是Gentoo Linux?
    服务器用什么Linux系统较好?
    轻型简易的Linux桌面环境推荐
    扩大VMware虚拟机中linux硬盘空间
    archbang 硬盘安装
    持续改进中, Gnome Shell 2.91.3 发布
    群英战吕布 2010年十大Linux PK WIN7
    将LFSliveCD安装到硬盘的注意事项
    ArchLinux安装笔记(续)(桌面篇)
  • 原文地址:https://www.cnblogs.com/autoria/p/6158687.html
Copyright © 2020-2023  润新知