You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
492 B

from django.contrib.sites.models import Site
from django.views.generic.base import ContextMixin
class BaseMixin(ContextMixin):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
pk = self.kwargs.get('pk')
if pk:
context['pk'] = pk
context['domain'] = Site.objects.get_current().domain
return context
# import code; code.interact(local=dict(globals(), **locals()))