How to use 'django templateview' in Python

Every line of 'django templateview' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
338def test_template_engine(self):
339 """
340 A template view may provide a template engine.
341 """
342 request = self.rf.get('/using/')
343 view = TemplateView.as_view(template_name='generic_views/using.html')
344 self.assertEqual(view(request).render().content, b'DTL\n')
345 view = TemplateView.as_view(template_name='generic_views/using.html', template_engine='django')
346 self.assertEqual(view(request).render().content, b'DTL\n')
347 view = TemplateView.as_view(template_name='generic_views/using.html', template_engine='jinja2')
348 self.assertEqual(view(request).render().content, b'Jinja2\n')
87def registration_view(template):
88 """Helper function to return TemplateViews."""
89 return TemplateView.as_view(template_name='registration/%s' % template)

Related snippets