vue.jsbuild之后是在django下面运行的,首页用一个djangoview渲染,通过context给它传递了参数,到了index.html中拿到参数后,怎样进一步传递到app里面?classIndexPageView(TemplateView):defget_context_data(self,**kwargs):context=super().get_context_data(**kwargs)context['now']=timezone.now()returncontexturlpatterns=[url(r'^admin/',admin.site.urls),url(r'^api/',include('api.urls')),url(r'^$',IndexPageView.as_view(template_name="index.html")),] contextfromdjango:{%templatetagnow%}
慕的地8271018
慕的地10843
相关分类