Skip to content

gdrive

GoogleDriveSubmodel

Bases: BaseSettingsModel

Specific settings for Google Drive sites.

.json file for service account which must have access

to shared GDrive folder/drive

root: root folder on GDrive, /My Drive prefix is required for classic GDrive, shared disks don't need that

Source code in server/settings/providers/gdrive.py
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class GoogleDriveSubmodel(BaseSettingsModel):
    """Specific settings for Google Drive sites.

    credentials_url: .json file for service account which must have access
        to shared GDrive folder/drive
    root: root folder on GDrive, `/My Drive` prefix is required for classic
        GDrive, shared disks don't need that
    """
    _layout = "expanded"
    credentials_url: CredPathPerPlatform = Field(
        title="Credentials url",
        scope=["studio", "project", "site"],
        default_factory=CredPathPerPlatform,
        description="""Path to credentials .json available on shared disk."""
    )

    roots: str = Field(
        "",
        title="GDrive root folder",
        scope=["studio", "project"],
        description="Root folder on Google Drive",
    )