title: How to create charts with Plotly on Django?
body: <p>I am trying to create a dashboard where I can analyse my model's data (Article) using the library <a href="https://plot.ly/python/" rel="noreferrer">plotly</a>.</p>
  
  <p>The Plotly bar chart is not showing on my template, I am wondering if I am doing something wrong since there's no error with the code below :</p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>from django.db import models
  from django.contrib.auth.models import User
  import plotly.plotly as py
  import plotly.graph_objs as go
  
  class Article(models.Model):
      user = models.ForeignKey(User, default='1')
      titre = models.CharField(max_length=100, unique=True)
      slug = models.SlugField(max_length=40)
      likes = models.ManyToManyField(User, related_name="likes")
  
      def __str__(self):
          return self.titre
  
      @property
      def article_chart(self):
          data = [
              go.Bar(
                  x=[self.titre], #title of the article
                  y=[self.likes.count()] #number of likes on an article
              )
          ]
          plot_url = py.plot(data, filename='basic-bar')
  
          return plot_url
  </code></pre>
  
  <p><strong>dashboard.html</strong></p>
  
  <pre><code>&lt;div&gt;{{ article.article_chart }}&lt;/div&gt;
  </code></pre>
  
  <p>Why is the bar chart not visible? Any suggestion ?</p>