gkuhn1 / django-admin-multiupload

Multi file upload for django-admin app
71 stars 64 forks source link

confused on integration... #20

Closed kinganu closed 7 years ago

kinganu commented 7 years ago

Hi im new to django, just trying to add multiple upload images to my blog Post model in Django admin panel. Right now I have a simple single image upload using ckeditor but I need to be able to simply upload multiple images without a convoluted rats nest of functions and widgets. I am unclear on your readme, where does the code block below this line go? Would be nice to have a clearer guide on how to integrate this easily.

  1. Inherit Your ModelAdmin from multiupload.admin.MultiUploadAdmin

Here is my simple Post model and post.html template:


class Post(models.Model):
    user = models.ForeignKey(User)
    title = models.CharField(max_length = 140)
    body = models.TextField()
    date = models.DateTimeField()
#    image = models.ImageField(upload_to='uploads')

<div class="container">
        <div class="col-md-12 text-center">
            <h3> {{ post.title }} </h3> <br>
            <h6> on {{ post.date }} </h6> <br>
        <img src="{{ post.image.url }}" class="img-responsive center-block" align="left" height="35%" width="35%" alt=""> 
         {{ post.body|safe|linebreaks }}
        </div>
</div>      
gkuhn1 commented 7 years ago

If you still need help let me know.