title: displaying all images from directory Django
body: <p>I am not sure how to display images from a directory onto a page. I am trying to create a gallery app. I am I am trying to do this bit by bit. My goal would be to create a thumbnail (first image of photos) for the album. When the album is clicked, all the images should be displayed. I think this would be done with an AJAX request. Not quite sure as I am new to web development. I need some help setting this up.</p>
  
  <p>structure of images:</p>
  
  <pre><code>/gallery
     /static
        /images
           /album1
              img1
           /album2
              img2
           ...etc
  </code></pre>
  
  <p>I'm not sure how to get these images in my views.py and display them on an html page. </p>
  
  <p>Here is the models.py I came up with but probably needs more work:</p>
  
  <pre><code>class Album(models.Model):
      title = models.CharField(max_length = 60)
      def __unicode__(self):
          return self.title
  
  class Image(models.Model):
      title = models.CharField(max_length = 60, blank = True, null = True)
      tags = models.ManyToManyField(Tag, blank = True)
      albums = models.ManyToManyField(Album, blank = True)
      width = models.IntegerField(blank = True, null = True)
      height = models.IntegerField(blank = True, null = True)
  </code></pre>
  
  <p>I feel I might be missing some things in my Image class such as <code>ImageField</code> or <code>FileField</code> but I am putting the files in the directory manually so I'm not sure if there are required.</p>