【问题标题】:cappuccino django integration卡布奇诺 Django 集成
【发布时间】:2011-04-01 19:38:47
【问题描述】:

您好,有人将卡布奇诺与 django 集成在一起吗? 我想用 cappuccino 作为前端,django 作为后端,并通过 CFHTTPRequest / Json 进行通信。

我做了以下事情: 将卡布奇诺应用程序复制到我的 django 应用程序的模板文件夹中。然后对cappuccino生成的index.html使用了一个render_to_response。

不幸的是,什么也没发生。

【问题讨论】:

  • 是的,也许 nailer 已经尝试过,可以响应或向 django 提供示例迭代。 Cappuccino 仅描述了如何将其与 ruby​​ on rails 集成

标签: django cappuccino


【解决方案1】:

不确定您要做什么,但我确实使用 Cappuccino 和 Django 作为后端。我使用 Piston 框架公开了一个标准 RESTful API,然后 Cappuccino 客户端使用常规 CPURLRequest 和 CPURLConnection 类调用该 API。

Cappuccino 应用程序作为常规静态文件提供,index.html Cappuccino 为您提供了 Django 模板。

【讨论】:

  • 你是如何从 django 调用卡布奇诺 index.html 的。我从 views.py def testcapu(request): return render_to_response('index.html', {}) 尝试了这个,我只看到 Loading NewApplication... 就是这样。
  • 我也试过:def testcapu(request): return HttpResponse(open('/Users/xxxxxx/Downloads/Starter/NewApplication/index.html').read()) 同样只显示加载
  • 得到它只是将卡布奇诺项目复制到静态文件夹。然后将 index.html 的内容复制到 templates/mapp.html 并使用 {{MEDIA_URL}} 更改路径 return render_to_response('testcappu.html', {}, context_instance = RequestContext(request))
猜你喜欢
  • 1970-01-01
  • 2010-11-03
  • 2011-05-16
  • 1970-01-01
  • 2011-05-07
  • 2011-05-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多