title: Django import excel file using openpyxl
body: <p>I want to add an excel file to my model 
  My view code is like this by using openpyxl :</p>
  
  <pre><code>def excel_import(request):
  uploadform=UploadFileForm(None)
  if request.method == 'POST' :
      uploadform = UploadFileForm(request.POST, request.FILES)
      if uploadform.is_valid():
          file = uploadform.cleaned_data['docfile']
          workbook = openpyxl.load_workbook(filename=file, read_only=True)
  
          first_sheet = workbook.get_sheet_names()[0]
          worksheet = workbook.get_sheet_by_name(first_sheet)
  
          data = []
  
          for row in worksheet.iter_rows(row_offset=1): # Offset for header
  
                  stock = Stocks()
                  stock.user = request.user
                  stock.name = row[0].value
                  stock.number = row[1].value
                  stock.suffix = row[2].value
                  stock.brand = row[3].value
                  stock.comment = row[4].value
                  stock.price = row[5].value
                  stock.date = datetime.today()
                  stock.confirm = 'approved'
                  stock.seller = row[7].value
                  data.append(stock)
  
              # Bulk create data
          Stocks.objects.bulk_create(data)
  
  
  return render(request, 'BallbearingSite/news.html',{'uploadform':uploadform})
  </code></pre>
  
  <p>the problem is it add some extra empty rows to the database .
  what is the problem with codes ? How can i fix it ? </p>