Skip to content

Configuring remote storage options in PyWPS

Vikas Mishra edited this page Jul 17, 2016 · 1 revision

PyWPS supports the following remote storage options so far:

  1. Dropbox
  2. Google Drive
  3. FTP

You can follow the following guide to get up and running the above mentioned storage options in addition to currently implemented local storage of the generated output.

1. Dropbox

Since PyWPS uses external libraries to provide the support for these remote storage option you are required to install some dependencies depending on which storage option you are going to use. For dropbox you need to install dropbox which is an official dropbox API client in Python. To install it using pip you just need to type the following command in the terminal: pip install dropbox

Once you've installed dropbox you need to generate an access token to allow PyWPS to upload the output files. You can follow the steps mentioned here for generating an access token. Once you have the access token you just need to paste the access token in the configuration file in the field dropbox_access_token under the heading remote-storage.

To enable dropbox as your storage option you also need to update the field storage_option in your configuration file so it reads as storage_option=dropbox

2. Google Drive

Since PyWPS uses external libraries to provide the support for these remote storage option you are required to install some dependencies depending on which storage option you are going to use. For Google Drive you need to install google-api-python-client To install it using pip you just need to type the following command in the terminal: pip install --upgrade google-api-python-client

To interact with the Drive API, you need to enable the Drive API service for your app. You can do this in the Google API project for the app. To do this you first need to go to the Google Developer Console and search for Drive API and enable it for that project. Once you've enabled the API you can generate a the secret file by following the steps from here and remember the path where you download this file.

Once you're done with the above steps you can go ahead and update the field drive_secret_file in the configuration file with the path where you downloaded the json file in the above step and also change storage_option to storage_option=googledrive

3. FTP Storage

If you wish to use FTP storage option as the default for saving the outputs you don't need to install any external library since ftplib is already installed with Python. You just need to update the configuration file with the details of your FTP credentials and update the field storage_option to make it look like storage_option=ftp. FTP credentials include ftp_host, ftp_user, ftp_password and ftp_secure change ftp_secure to true only if your host supports secure ftp connections or you won't be able to upload files to your ftp server.