title: Best practice for adding data to a PostgreSQL database?
body: <p>I'm trying to add a static amount of data from a csv file into a postgresql database that im hosting on Heroku. </p>
  
  <p>Initially, I was doing this programmatically in my application.py file, which was serving the web server with flask. I'm interacting with the database using SQLalchemy</p>
  
  <p>Basically, I have this block of code where I'm committing data to my database before I'm handling routes.</p>
  
  <pre><code>for el in books:
     db.execute("INSERT INTO books (isbn, title) VALUES (:isbn, :title)",
               {"isbn": el[0], "title": el[1]})
     db.commit
  </code></pre>
  
  <p>I think that the biggest problem with doing this is the web server is that I'm commiting the same data each time I restart my web server. Does anyone have advice for the best way that I should be doing this process?</p>