虽然确保在/ views文件夹中包含视图的相对路径,但您确实已经完成了它.因此,如果你有/views/default/other_view.html,你可以这样做:
response.view = 'default/other_view.html'
Run Code Online (Sandbox Code Playgroud)
您还可以直接渲染任何视图:
def myfunc():
context = dict(...)
return response.render('default/other_view.html', context)
Run Code Online (Sandbox Code Playgroud)