Skip to content

Developer Setup and Tips

Dave Lawrence edited this page Aug 7, 2026 · 5 revisions

Table of contents

Getting started

Follow Install (Developer) — it clones as your own account, keeps your settings out of source control in variantgrid/settings/env_developers/, and skips the service user and system services a deployed server needs.

Run the dev server with:

python3 manage.py runserver

See Run VariantGrid for running the Celery workers you need for async work (imports, annotation).

Django debugging

django-debug-toolbar is in requirements.txt — see https://django-debug-toolbar.readthedocs.io/en/latest/ for enabling it (add to INSTALLED_APPS + MIDDLEWARE in your developer settings file, and set INTERNAL_IPS).

django-extensions is also available, which gives you shell_plus (auto-imports your models) and runserver_plus:

python3 manage.py shell_plus --print-sql

To see the SQL a queryset generates without running it, print(qs.query). For analysis nodes there's a debug view (analysis.views.views.node_debug) reachable from the node — see Analysis Grid Columns.

SCSS

SCSS (Sassy CSS) lets you write CSS with some extra features, compiled to CSS for browsers. Even if you don't use the advanced features, the resulting CSS is relatively minimised with comments removed. See vc_form.scss vs vc_form.css for an example.

sassc is installed by scripts/install/ubuntu_install_dependencies.sh, so you should already have it.

PyCharm

  • File -> Settings
  • Search for "watcher" or Tools -> Watchers
  • Add, "SCSS"
  • Add --style expanded to command line arguments, so that we don't get whitespace formatting changes fights between dev machines.

Linting

# Run pylint (output to lint.txt)
./scripts/linting/run_pylint.sh

# Run eslint over the JavaScript
./scripts/linting/run_eslint.sh

# Auto-fix whitespace/formatting issues with autopep8
./scripts/linting/format_code.sh

See Also

Clone this wiki locally