title: How to upload file to google drive with service account credential
body: <p>I wanted to upload the files to my Google Drive using a Google service account credentials.</p>
  
  <p>I downloaded credential as a JSON file from Google Developer Console, and got credential from it.</p>
  
  <p>Here is my code snippet.</p>
  
  <pre><code>google_drive_service = discovery.build('drive', 'v3',
            credentials=ServiceAccountCredentials.from_json_keyfile_name
                             os.path.join(settings.CLIENT_PATH, settings.CLIENT_SECRET_FILE),
                             scopes=settings.SCOPES))
  
  
  media = MediaFileUpload(tmp_file_path, mimetype=tmp_file.content_type, resumable=True)
  google_drive_service.files().create(body=file_metadata, media_body=media, fields='id').execute()
  </code></pre>
  
  <p>The code runs and there is no error, however I can't find out the files uploaded to my Google Drive account. I am not sure why files are not uploaded. Would you like to help me to fix this problem? </p>