I have a csv file which has contents like the following:
stores.csv
Site, Score, Rank
roolee.com,100,125225
piperandscoot.com,29.3,222166
calledtosurf.com,23.8,361542
cladandcloth.com,17.9,208670
neeseesdresses.com,9.6,251016
...
Here's my model.
models.py
class SimilarStore(models.Model):
store = models.ForeignKey(Store)
csv = FileField()
domain = models.CharField(max_length=100, blank=True)
score = models.IntegerField(blank=True)
rank = models.IntegerField(blank=True)
So, I wanna upload the stores.csv file into csv field so that each column data goes into each domain, score, and rank.
I found out some resources making python file to parse data and run it through a command like `python parse.py'. However, I need it to be done by uploading the csv file in Django admin. Can anyone explain how I can do that?