March 2020
Intermediate to advanced
608 pages
17h 17m
English
Follow these steps to create a Song model and a management command, which imports the top tracks from Last.fm to the database in XML format:
# myproject/apps/music/management/commands# /import_music_from_lastfm_xml.pyfrom django.core.management.base import BaseCommandclass Command(BaseCommand): help = "Imports top songs from last.fm as XML." SILENT, NORMAL, VERBOSE, VERY_VERBOSE = 0, 1, 2, 3 API_URL = "https://ws.audioscrobbler.com/2.0/" def add_arguments(self, ...