A
A
Argam2019-07-19 23:10:02
Django
Argam, 2019-07-19 23:10:02

How do I add photos to a Django model?

i would like to know how can i add multiple photos in django product .thank you

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2019-07-19
@fox_12

And what is the difficulty?:

class Product(models.Model):
      ...

class ProductPhoto(models.Model):
     product = models.ForeignKey(Product)
     photo = models.ImageField()
     ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question