title: How to upload multiple images for my product model in django?
body: <p>I want to upload multiple images of the product so how can I do that? Django version is 2.1 and how to store the multiple files as well.
  Using python3</p>
  
  <p>My model</p>
  
  <pre><code>class Product(models.Model):
  owner = models.ForeignKey(UserProfile, on_delete=models.CASCADE)
  name = models.CharField(max_length=33, blank=True)
  description = models.TextField()
  postdate = models.DateTimeField(auto_now_add=True, blank=False)
  duration = models.IntegerField(null=True, blank=True)
  image = models.FileField(upload_to=product_directory_path, blank=False, default='default.jpg')
  </code></pre>
  
  <p>My View</p>
  
  <pre><code>def addProduct(request):
  if request.method == 'GET':
      if request.user.is_authenticated:
          return render(request, 'postAd.html')
  
  if request.method == 'POST' and request.FILES.get('image'):
      if request.user.is_authenticated:
          user = User.objects.get(id=request.user.id)
          owner = UserProfile.objects.get(email=user.email)
          image = request.FILES.get('image')
          name = request.POST['name']
          description = request.POST['desc']
          pr = Product(owner=owner, name=name, image=image, description=description, category=category, price=price, ptype=ptype)
          pr.save()
          return HttpResponseRedirect(reverse('ors:dashboard')) 
  </code></pre>