Directory structureΒΆ

The OpenSurfaces repository has the following structure:

server/              -- Django application ($SRC_DIR)
    config/                 -- general settings           -- settings specific to one machine  -- template for

    static/          -- common static files
    templates/       -- common templates

                     -- Django apps:
    common/          -- common utilities by all other packages
    home/            -- Home page, publications page
    mturk/           -- mturk platform
    accounts/        -- user accounts
    photos/          -- photos and scene categories
    shapes/          -- shape segmentation, object name, material name
    poly/            -- polygon utilities and segmentation UI
    bsdfs/           -- BSDF matching
    normals/         -- surface normals
    intrinsic/       -- intrinsic images
    licenses/        -- copyright licensing / creative commons
    analytics/       -- statistics web pages

venv/                -- virtual python environment ($VENV_DIR)
        activate     -- sets up virtualenv in the current shell

scripts/             -- bash scripts        -- settings for bash scripts

run/                 -- dynamic files for the running website
    gunicorn.sock    -- socket file (nginx <--> gunicorn communication)
    gunicorn.log     -- web access log (only dynamic pages)

docs/                -- documentation

triangulate/         -- utility to triangulate complex polygons

prefilter/           -- prefiltered environment maps for BRDF matching

opt/                 -- external libraries

$DATA_DIR/           -- local data (defined in scripts/
    static/          -- copies of static files to be served by nginx
    media/           -- local files/images (if not served from S3)

$BACKUP_DIR/         -- database backups (defined in scripts/
    pg_dump.sql.gz   -- postgresql dump file used for restoring the database

Each Django app is organized as follows:

APP_NAME/          -- Django models           -- Celery tasks            -- URL mapping (from URL to functions in           -- view functions           -- unit tests           -- registers models with the Django admin interface         -- register Django signals
    *.py               -- other modules specific to APP_NAME

        commands/      -- management commands (call with ./ cmd)

        APP_NAME/      -- templates (HTML, SVG fragments)

    static/            -- static files (served by nginx)
            APP_NAME/  -- coffeescript/javascript files
            APP_NAME/  -- less/css files
            APP_NAME/  -- images

    cmd -> management/commands
    css -> static/APP_NAME/css
    js  -> static/APP_NAME/js
    img -> static/APP_NAME/img


For templates and static, all files are in an additional nested level, i.e. APP_NAME/static/APP_NAME/css instead of APP_NAME/static/css.

When Django merges all the directories together, if you don’t have the extra APP_NAME subdirectory, different apps will potentially overwrite each other. Since the extra subdirectory is annoying, there are symlinks (js -> static/APP_NAME/js, css -> static/APP_NAME/css, etc.) for convenience.