[Django]-Django flatpages and images

1👍

simplest way is to upload images to a photo hosting (picasa, flickr etc). If you prefer to stick with django admin, you can write a simple app with a single model like this:

class Image(models.Model):
    title    = models.CharField(max_length=255)
    file    = ImageField(upload_to='car_images')

    def get_absolute_url(self):
        return (self.file and self.file.url) or ''
👤Marat

Leave a comment