# cannot save data using Manage.py shell with no Errors

**URL:** <https://forum.djangoproject.com/t/cannot-save-data-using-manage-py-shell-with-no-errors/10756>\
**Category:** Using Django\
**Created:** [December 1, 2021, 8:18am UTC](https://forum.djangoproject.com/t/cannot-save-data-using-manage-py-shell-with-no-errors/10756 "2021-12-01T08:18:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![firaki12345](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/firaki12345/32/4251_2.png) [@firaki12345](https://forum.djangoproject.com/u/firaki12345)\
**Post date:** [December 1, 2021, 8:18am UTC](https://forum.djangoproject.com/t/cannot-save-data-using-manage-py-shell-with-no-errors/10756/1 "2021-12-01T08:18:28Z")

</div>

**Alrite i have no idea why is it doing this ? My Json file contains 2567 entries per column**

**My Models File:**

```auto
from django.db import models
import base64
from django.utils import timezone
from django_extensions.db.fields import AutoSlugField

# Create your models here.

class retailers(models.Model):

	links = models.CharField(max_length=2000,unique=True)
	shop = models.TextField()
	country = models.TextField()
	category = models.TextField()
	title = models.CharField(max_length=300)
	price = models.DecimalField(max_digits=10, decimal_places=2)
	images = models.TextField()
	color = models.TextField()
	slug = AutoSlugField(populate_from=['country', 'shop', 'category', 'title'])
	date_posted = models.DateTimeField(default=timezone.now)

	def __str__ (self):
		
		return self.title

	def save(self, *args, **kwargs):

		if self.images[0:3] == "\\x":

			A = self.images.replace("\\x","")

			binary_data = bytes.fromhex(A)

			base64_bytes = base64.b64encode(binary_data)

			base64_string = base64_bytes.decode()

			self.images = base64_string

			super().save(*args, **kwargs)

```

**My Manage py Shell Code:**

```auto
import pandas as pd
from prods.models import retailers

R = pd.read_json("Final.json")

Links = R["links"].tolist()
Shop = R["shop"].tolist()
Country = R["country"].tolist()
Category = R["category"].tolist()

Title = R["title"].tolist()
Price = R["price"].tolist()
Images = R["images"].tolist()
Color = R["color"].tolist()

for L,S,CTRY,CT,T,P,I,CL in zip(Links,Shop,Country,Category,Title,Price,Images,Color):

	K = retailers(links = L , shop = S,country = CTRY ,category = CT, title = T, price = P ,images = I,color = CL)
	K.save()

```

**This exact same code works when i had only 86 entries… SO maybe too much data ??**

**I Even tried retailers.objects.create, still no data is saved**

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [December 1, 2021, 12:04pm UTC](https://forum.djangoproject.com/t/cannot-save-data-using-manage-py-shell-with-no-errors/10756/2 "2021-12-01T12:04:19Z")

</div>

What specifically is happening, or not happening?

Is it just stopping part-way through? Or are you getting no data at all?

Have you verified that the json file is correct, and that the 8 lists you are creating from it are all populated correctly?

Have you checked all the data in each of the lists to verify you have the right types of data in each list?

---

<div class="post-metadata">

**Author:** ![firaki12345](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/firaki12345/32/4251_2.png) [@firaki12345](https://forum.djangoproject.com/u/firaki12345)\
**Post date:** [December 1, 2021, 12:39pm UTC](https://forum.djangoproject.com/t/cannot-save-data-using-manage-py-shell-with-no-errors/10756/3 "2021-12-01T12:39:55Z")

</div>

hi it Finally worked when i removed the if statement.

```auto
	def save(self, *args, **kwargs):

			A = self.images.replace("\\x","")

			binary_data = bytes.fromhex(A)

			base64_bytes = base64.b64encode(binary_data)

			base64_string = base64_bytes.decode()

			self.images = base64_string

			super().save(*args, **kwargs)

```
