ImportError: cannot import name secure_dumps

ImportError: cannot import name secure_dumps

我正在尝试使用独立版本的 web2py 的 DAL。我查看了其他几篇文章(here 和其中引用的 link),但仍然无法解决问题。我所做的是将 gluon 文件夹从 web2py 目录复制到我的目录中,然后我做了一个导入语句,例如:

from gluon import DAL, Field

导致以下错误:

  File "/home/ec2-user/myproject/gluon/globals.py", line 26, in <module>
    from gluon.utils import web2py_uuid, secure_dumps, secure_loads ImportError: cannot import name secure_dumps

我检查过 utils.py 存在于 gluons 文件夹中并且其中定义了 secure_dumps 函数。如果有人可以就如何解决此错误提供一些建议,我们将不胜感激。

这个问题的解决方案是使用 gluino 而不是 gluongluino 是 web2py 到 Bottle 和其他 web 框架的端口,可以下载 here