dj-stripe / dj-stripe

dj-stripe automatically syncs your Stripe Data to your local database as pre-implemented Django Models allowing you to use the Django ORM, in your code, to work with the data making it easier and faster.

Home Page:https://dj-stripe.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syncing data from stripe to djstripe_product table

sourcesolver opened this issue · comments

I would like to know if the sync script can pull images from the stripe console into the image field of djstripe_product.

I have used this command "python3 manage.py djstripe_sync_plans_from_stripe" to sync my stripe and my djstripe tables in my database. Unfortunately, the image doesn't sync into the images column (evidently a JSONField; c.f., https://dj-stripe.dev/dj-stripe/2.7/reference/models) of the djstripe_product table. I have attached a screenshot of how I have the product image uploaded and saved to a test product in my stripe console.

2023-07-31 22 08 57 dashboard stripe com e99560908cfd

@sourcesolver the djstripe_sync_plans_from_stripe is legacy. We would suggest using djstripe_sync_models Product instead of that and yes the product images will be retrieved as well.

That's the model definition from the link you posted.

images = JSONField(null=True, blank=True, help_text=( "A list of up to 8 URLs of images for this product, meant to be displayable to the customer. Only applicable to products of `type=good`."),)