How to use gsutil from a django project

  google-cloud-platform, gsutil, python, wsgi

I am able to use gsutil on the command-line, however when trying to do this within django I get the following error:

enter image description here

Basically, it seems it’s trying to use the /var/www/snap directory from django, which I believe it’s not allowed to do based on its permissions. What should be done here?

The command I am currently using is:

cmd = f"/snap/bin/gsutil cp {source} {destination}"
subprocess.call(cmd, shell=True)

Source: Python Questions

LEAVE A COMMENT