The comma-separated values (CSV) format is probably the simplest way to store tabular data in a text file. In this recipe, we will create a management command that imports data from a CSV file to a Django database. We will need a CSV list of movies. You can easily create such files with Excel, Calc, or another spreadsheet application.
Importing data from a local CSV file
Getting ready
Create a movies app with the Movie model containing the following fields: title, release_year, rating, and rank. You may already have such an app created if you worked through the Filtering object lists recipe in Chapter 3, Forms and Views. If you've just created the app, make sure to add it under INSTALLED_APPS in the settings and migrate...