title: Django Channel web sockets - append message to Model.objects
body: <p>Lately, I've been investigating onto integrating web sockets into Django. According to the documentation, using <a href="https://channels.readthedocs.io/en/latest/" rel="nofollow">Channels</a> is the way to go. </p>
  
  <p>Given an illustrative model <em>Query</em></p>
  
  <pre><code>class Request(models.Model):
      id = models.IntegerField(name="id", primary_key=True)
      query = models.CharField(name = 'query', max_length=1024)
  </code></pre>
  
  <p>I want to have my web application connected to a web socket server. When the web socket server receives a message, it should broadcast that message to a particular subset of socket connections established by the client. </p>
  
  <p>The client (namely web browser), once receiving the broadcasted message, it should append it to <em>Request.objects</em>. From there on, the list of all queries should be automatically updated using Django templates and within it the defined model - without forcing the user to explicitly refresh it.</p>
  
  <p>Hence, the questions of mine are: (I) using Channels (if this is the preferred way of dealing web socket connections in Django), how can I append the newly arrived <em>Query</em> object to <em>Query.objects</em> - without storing the object into the database because it has already been inserted prior sending to the web socket server, (II) refresh the content of the corresponding Django template. </p>