让我为你分解一下。我正在使用 Django 1.4(所以,显然也使用 Python,这将是 v2.7.1)。在 SoundClouds Developer 文档中,它说您可以使用以下代码嵌入播放器 - 假设您已经注册了您的应用并下载了 SDK(我已经完成了):
import soundcloud
# create a client object with your app credentials
client = soundcloud.Client(client_id='YOUR_CLIENT_ID')
# get a tracks oembed data
track_url = 'http://soundcloud.com/forss/flickermood'
embed_info = client.get('/oembed', url=track_url)
# render the html for the player widget
return render_template('player.html', widget=embed_info['html'])
所以我的问题是这个 render_template 来自哪里?我在 Django 中收到一个错误,说未定义 render_template。这和django中的render_to_response一样吗?我不确定这里是什么。谢谢。
[编辑] SoundClouds 开发者文档:http: //developers.soundcloud.com/docs#playing