vue.js build is run under django. The home page is rendered with a django view, and the parameters are passed to it through context. After getting the parameters in index.html, how to pass them to app?
class IndexPageView(TemplateView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["now"] = timezone.now()
return context
urlpatterns = [
url(r"^admin/", admin.site.urls),
url(r"^api/", include("api.urls")),
url(r"^$", IndexPageView.as_view(template_name="index.html")),
]
<body>
<div style="display: none;">
context from django: {% templatetag now %}
</div>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>