[Django]-How do you have a dynamic template name using class based generic views in django?

5👍

try this (not tested):

class AboutView(TemplateView):
    def get_template_names(self):
        return ["about/%s.html" % self.args[0]]

👤akonsu

Leave a comment