在Tornadoweb中禁用模板处理 [英] Disable template processing in Tornadoweb
问题描述
对于我们现有的AngularJs应用程序,我必须使用Tornadoweb作为RESTfull后端.
I have to use Tornadoweb as RESTfull backend for our existing AngularJs application.
{{}}在角度应用程序中大量使用.我想将龙卷风的角文件作为静态文件提供
The {{}} are heavily used in the angular app. I would like to serve angular files from tornado as static files
是否可以通过龙卷风禁用处理模板以避免与龙卷风使用的{{}}发生冲突?
我知道如何使用$ interpolateProvider更改角度应用程序中的{{}},但这将涉及角度应用程序中的许多更改.
I know how to change the {{}} in the angular app with $interpolateProvider but it will involve a lot of changes in the angular app.
作为一个临时解决方案,我将有角度的应用程序放置在龙卷风的静态文件夹中,并使用了重定向:
As a temporary solution, I put the angular app in the static folder of tornado and used a redirect:
class IndexHandler(RequestHandler):
def get(self):
self.redirect(self.static_url('ng-app/index.html'),True)
它正在工作,但不是一个很好的解决方案,因为显示的URL类似于:
It is working but it is not a nice solution because The url displayed is some thing like :
http://localhost:8080/static/ng-app/index.html?v=efb937e6a0cb0739eb0edfd88cfb4844
有更好的主意吗?
提前谢谢
推荐答案
使用{{!tag}}禁用龙卷风的翻译.
Use {{!tag}} to disable the translation of tornado.
这篇关于在Tornadoweb中禁用模板处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!