# -*- coding: UTF-8 -*-
from django.conf import settings
class NewStyleTemplateDir(object):
@staticmethod
def process_request(request):
if request.GET.get('new_style'):
settings.TEMPLATES[0]['DIRS'] = ['новая директория с шаблонами']
class MyView(TemlateView):
def get_template_names(self):
style = self.request.GET.get('new_style', 0)
if style == 1:
return list(map(lambda t: '_{}'.format(t), super().get_template_names())
return super().get_template_names()