连接 Sproutcore 前端和自定义 Python 后端
我正在构建一个基于网络的应用程序。前端是在 Sproutcore 中设计的。对于后端,我们有自己的 python API,它可以处理多个数据库的所有事务。连接前端与后端的最佳方式是什么?
AFAIK django 相当单一(如果我错了,请纠正我),如果我不使用它的原生 ORM,那会很麻烦......我更喜欢基于 python 的解决方案......有什么想法吗?
谢谢!
苏维尔
I am building a web-based application. The frontend has been designed in Sproutcore. For the backend, we have our own python API which handles all transactions with multiple databases. What is the best way to hook up the front-end with the back-end.
AFAIK django is pretty monolithic (correct me if i am wrong) and it would be cumbersome if I dont use its native ORM...I would prefer a python-based solution..any ideas?
thanks!
Suvir
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对 sproutcore 唯一了解的是我大约 10 秒前读到的回答这个问题的内容。 Javascript 可以执行 ajax,所以我认为 sproutcore 也可以。因此,向后端提供restful api+json 是一种选择。如果您需要将其出售给老板,请将其称为面向服务的架构。在他可以在本周的《信息周刊》中查找之前,您可能已经让它工作了。
其工作所需的只是能够响应 http 请求并返回 json 的任何内容。有数十亿个网络框架可以做到这一点。您已经提到过一个,并且可能会再次提到。不过,我会继续说明我的偏好。 bfg 或 pylons< /a> 其中任何一个都适合你并且几乎不会妨碍你。当然还有其他的,也许在使用它们之后,您可能会发现您可以非常轻松地编写自己的代码,只需使用 Webob(由 pylons 和 bfg 等使用)或直接 wsgi< /a> 或者根据您的需要使用适当的片段将所有这些组合起来。
The only thing I know about sproutcore is what I read about 10 seconds ago to answer this. Javascript can do ajax so I assume so can sproutcore. So providing a restful api+json to your backend would be an option. If you need to sell it to your boss, call it a service oriented architecture. You'll probably have it working before he can look it up in this weeks Information Weekly.
All that's required for that to work is anything that can answer an http request and return json. There are a bizillion web frameworks out there that can do this. You mentioned one already and it will probably be mentioned again. I'll go ahead and state my preference though. bfg or pylons either of which will work for you and pretty much stay out of your way. There are others of course, and maybe after playing with them you might find you could write your own pretty easy either using just Webob (used by pylons and bfg and others) or straight wsgi OR a combination of all of them using pieces where appropriate according to your needs.
如果您只是想要简单的话,还有 Bottle.py。
There's also Bottle.py if you just want it simple.