File size: 660 Bytes
aff4b27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
with open("./api/bhajanData.json", "r",encoding="utf-8") as f:
        data = json.load(f)["Prasang"]
    for bhajan in data:
        category = BhajanCategory.objects.filter(link=bhajan['CatId']).first()
        Bhajan.objects.create(
            title=bhajan['title'],
            title_guj=bhajan['title_guj'],
            category=category,
            lyrics=bhajan['lyrics'],
            isEng = bhajan['isEng'],
            isHnd = bhajan['isHnd'],
            isGer = bhajan['isGer'],
            isAudio = bhajan['isAudio'],
            audio_url=bhajan['audio_url'] if bhajan['isAudio'] else ""
        )
        print(bhajan['title'])