quick fix
							rodzic
							
								
									74e8822a18
								
							
						
					
					
						commit
						d688c00a80
					
				|  | @ -4,6 +4,7 @@ import requests | ||||||
| import pandas as pd | import pandas as pd | ||||||
| 
 | 
 | ||||||
| from django.core.files.base import ContentFile | from django.core.files.base import ContentFile | ||||||
|  | from django.conf import settings | ||||||
| from store.models import ( | from store.models import ( | ||||||
|     ProductTemplate, |     ProductTemplate, | ||||||
|     ProductCategoryParamValue, |     ProductCategoryParamValue, | ||||||
|  | @ -42,8 +43,9 @@ class ProductLoader(BaseLoader): | ||||||
|     def _get_images(self, row) -> list[ContentFile]: |     def _get_images(self, row) -> list[ContentFile]: | ||||||
|         url = row["images"] |         url = row["images"] | ||||||
|         images = [] |         images = [] | ||||||
|         response = requests.get(url+"/download", stream=True) |         response = requests.get( | ||||||
|         print(response.status_code) |             url+"/preview", stream=True | ||||||
|  |         ) | ||||||
|         if response.status_code == 200: |         if response.status_code == 200: | ||||||
|             data = response.content |             data = response.content | ||||||
|             image = ContentFile(data, name=row["template"]) |             image = ContentFile(data, name=row["template"]) | ||||||
|  |  | ||||||
		Ładowanie…
	
		Reference in New Issue
	
	 mtyton
						mtyton