title: Import CSV file into two separate django models
body: <p>I'm having trouble parsing data from one csv file into two related tables in a django model.</p>
  
  <p>My view.py function.</p>
  
  <pre><code>        for column in csv.reader(io_string, delimiter=',', quotechar="|"):
              _, created = User.objects.update_or_create(
                  card_no=column[0],
                  first_name=column[1],
                  last_name=column[2],
                  mobile=column[3],
                  email=column[4],
                  is_active=column[5]
              )
  
              _, created = UserPayment.objects.get_or_create(
                  paid_on=column[0],
                  valid_until=column[1],
                  payment_status=column[2]
              )
  </code></pre>
  
  <p>This is the CSV file.
  <a href="https://i.stack.imgur.com/JhDzA.png" rel="nofollow noreferrer">file image</a></p>
  
  <p>How can I save the CSV data into the models without any problem?</p>