我在 Django 中使用带有 WWW 接口的 C++ 开发应用程序。到目前为止,我已经在 C++ 中使用 Boost.Python 包装器编译为 Linux 中的共享对象。
现在我尝试在 Django 中运行这个框架。当我从表单“CharField”传递字符串时,出现此错误:
Python argument types in
CoreSystem.setOutput(CoreSystem, unicode)
did not match C++ signature:
setOutput(CoreSystem {lvalue}, std::string)
负责的代码在这里:
form = AnalyzeForm(request.POST)
if form.is_valid():
cd = form.cleaned_data
s.setOutput(cd["output"])
其中 s 是这个 CoreSystem 对象。如果我这样输入:
s.setOutput("DatabaseOutput")
它工作正常。我也使用了 str(cd["output"]) 但之后没有任何反应。
我正在使用 Django 1.4.1 和 Python 2.7.3