[Solved] TypeError: DisplayMarketingMessage() takes no arguments how to fix it

[ad_1]

you can try following implimentation

from django.utils.deprecation import MiddlewareMixin
class DisplayMarketing(MiddlewareMixin):
    def process_request(self, request):
        try:
            request.session['marketing_message']=MarketingMessage.objects.all()[0].message
        except:
            request.session['marketing_message']=False

[ad_2]

solved TypeError: DisplayMarketingMessage() takes no arguments how to fix it