from django.http import HttpResponse
from channels.handler import AsgiHandler, AsgiRequest
def http_request_consumer(message):
    response = HttpResponse('Hello world! You asked for %s' % message.content['path'])
    for chunk in AsgiHandler.encode_response(response):
        message.reply_channel.send(chunk)
        request =AsgiRequest(message)
    return  request