title: Send message using Django Channels from outside Consumer class
body: <p>I am building an online game, which uses Django channels 2.1.5 for websockets.</p>
  
  <p>I am able to build the connection between the client and the server, and also able to send data between them only inside the consumer class:</p>
  
  <pre><code>from channels.generic.websocket import WebsocketConsumer
  import json
  from . import controller
  
  class GameConsumer(WebsocketConsumer):
      def connect(self):
          self.accept()
          print("Wohooo .. Connected to client!")
          self.render()
          controller.startTurn()
  
      def render(self, type="render", message=None):
          self.send(controller.renderMap(type, message))
  
      def disconnect(self, close_code):
          print("WebSocket connection is lost...")
  
      def receive(self, text_data):
          text_data_json = json.loads(text_data)
          controller.handleRecieved(text_data)
  ...
  </code></pre>
  
  <p>Now, What I wish to do, is to call the function <strong>render</strong>, -which is inside the consumer class-, from another module</p>
  
  <p>I tried this:</p>
  
  <pre><code>from .. import consumer
  
  def sendDeployments(owner, armies):
      type = "renderDeployments"
      message = owner + " has " + str(armies) + " to deploy"
      dummyConsumer = consumer.GameConsumer()
      consumer.GameConsumer.render(type, message)
  </code></pre>
  
  <p>But failed because I can't use the "self" parameter from outside the class.</p>
  
  <p>Can anybody think of a way to achieve my goal?</p>
  
  <p>Ps: I don't care about synchronization at this occasion.</p>