title: improve performance of python django models.py query
body: <p>I am loading the website data into Postgres using Python-Django, there are around 9 csv files that i am loading to database but its taking so long ~10 hrs to fetch the data from website, and load it to Postgres. I wanted to increase the performance of the query. Can you guys please help with that?</p>
  
  <p>This is just 1 dataframe, but i have 9 more similar to that, overall data is less than 500k records</p>
  
  <pre><code>from django.db import models  
  from django_pandas.managers import DataFrameManager  
  import pandas as pd      
  from sqlalchemy import create_engine  
  import zipfile  
  import os  
  from urllib.request import urlopen     
  import urllib.request  
  import io  
  from io import BytesIO  
  
  class mf(models.Model):
      pg_engine = create_engine('postgresql://user:password@server:host/db')
      zf = zipfile.ZipFile(BytesIO(urllib.request.urlopen('http://md_file.zip').read()))
      df1 = pd.read_csv(zf.open('nm.dat'),header=None,delimiter='|', index_col=0, names=['aaa', 'xxxx', 'yyy','zzz'])
      df1.to_sql('nm',pg_engine,if_exists='replace')
  </code></pre>