title: Angular & Django File uploading : Forbidden (403) CSRF verification failed. Request aborted
body: <p>I encounted the following problem : Forbidden (403) CSRF verification failed. Request aborted.
  I'm using Angular 8 to upload file and send it to django for some manipulations without saving the file and then return the pandas DataFrame as json.
  Here is the Angular code:</p>
  
  <pre><code>uploadDatasetFile(formData : FormData){
      this._http.post(`${this.baseUrl}upload_dataset`, formData).subscribe(
        (data) =&gt; {
          this.dataFrame = data;
          console.log(data);
        },
        (error) =&gt; {
          console.error(error);
        } 
      );
    } 
  </code></pre>
  
  <p>And the Django codes:</p>
  
  <pre><code>def upload_local_dataset(request):
      if request.method == 'POST':
          print("Request FILES : ", request.FILES)
          dataset = pd.read_csv(request.FILES.get('datasetfilepath'), header=0, index_col=None)
          request.session['ts_dataset'] = dataset.to_json(orient='values')
          request.session['ts_dataset_copy'] = dataset.to_json(orient='values')
  
          return HttpResponse(dataset.to_json(orient='values'))
  </code></pre>
  
  <p>Thanks for your help. I'm new in Angular and Django, and I'm working on my internship project.</p>