title: Error when reading csv: coercing to Unicode: need string or buffer
body: <p>I am receiving the following error when I am reading a csv file in my Django project. </p>
  
  <pre><code>coercing to Unicode: need string or buffer, file found
  </code></pre>
  
  <p>I have searched the forum already, but could not find a solution to my problem. I also have no idea how to solve this. When I run this code locally I don't have the problem. Once I execute the script from my django views I get the error from above.</p>
  
  <p>coercing to Unicode: need string or buffer, file found</p>
  
  <pre><code>import os
  from django.conf import settings
  
  path = os.path.join(settings.BASE_DIR, 'technicalAnalalysis/EUR_USD')
  
  def index(request):
  
      return render(request, 'technicalAnalysis/home.html')
  
  
  
  class carouselData(APIView):
  
      authentication_classes = []
      permission_classes = []
  
      def get(self, request, format=None):
  
          import csv
  
          EUR_USD_closeBid = []
  
          with open(path) as csvfile:
  
              readCSV = csv.reader(open(csvfile), delimiter=str(',').encode('utf-8'), )
  
              for row in readCSV:
  
                  closeBid = row[0]
  
                  BOP = row[12] 
  
                  EUR_USD_closeBid.append(closeBid)
  
          data = {
              "EUR_USD_closeBid":EUR_USD_closeBid,
  
              }
  
          return Response(data)            
  </code></pre>
  
  <p>this is how the csv was created </p>
  
  <pre><code>master.to_csv(eachCurrency, encoding='utf-8', index=False)
  </code></pre>
  
  <p>and this how the csv data looks like</p>
  
  <pre><code>1.4551,2016-08-25T21:00:00.000000Z,1.46613370302,1.4588,1.45146629698,19.2623252118,16.0468541889,18.0294990319,52.3305843166,-0.000955558790503,0.00497888833433,0.00402332954383,-0.228110599078
  1.45557,2016-08-28T21:00:00.000000Z,1.46022799941,1.45683,1.45343200059,18.3020335848,15.2573095743,17.1424034245,52.7163692506,-0.00105527020367,0.00471507078342,0.00365980057975,0.655172413793
  1.45919,2016-08-29T21:00:00.000000Z,1.459965965,1.456766,1.453566035,17.7461955078,14.6233407849,18.0619294336,55.6907414516,-0.000874414835166,0.00449646707462,0.00362205223946,0.82183908046
  </code></pre>
  
  <p>Thanks a lot in advance and kind regards</p>