我想知道是否有可能在Eclipse IDE中为基于Django的模板进行自动完成,自动格式化以及那些美妙的工作.
主要针对这些事情: {% ... %} {{ ... }}
提前致谢
我必须构建一个小应用程序才能显示来自Google Financial API的一些数据.我知道我可以在里面研究它,但我没有太多时间.网址http://www.google.com/finance/info?q=MSFT返回此JSON字符串:
// [ { "id": "358464" ,"t" : "MSFT" ,"e" : "NASDAQ" ,"l" : "24.38" ,"l_cur" : "24.38" ,"ltt":"4:00PM EDT" ,"lt" : "Oct 1, 4:00PM EDT" ,"c" : "-0.11" ,"cp" : "-0.45" ,"ccol" : "chr" ,"el": "24.39" ,"el_cur": "24.39" ,"elt" : "Oct 1, 7:58PM EDT" ,"ec" : "+0.01" ,"ecp" : "0.04" ,"eccol" : "chg" ,"div" : "0.16" ,"yld" : "2.63" } ]
Run Code Online (Sandbox Code Playgroud)
我不知道如何使该字符串可用于视图.我需要"抓住它"并在我的模板中显示(部分)它.我需要这样的东西:
def myview(...)
URL = 'http://www.google.com/finance/info?q=MSFT'
mystring = catchfromURL(URL)
#work with the string
return …Run Code Online (Sandbox Code Playgroud)