Dedicated address
The study receives an HTTPS URL such as name.beer-lab.org and oTree administrative access.
Implementation
A practical guide to turn a reviewed project into a tested build, deploy it on the lab infrastructure, run sessions, and preserve the results.
Scope
The sequence below covers technical and operational implementation only. Use it as the shared reference for the research and lab teams during programming, validation, sessions, updates, and retirement.
01 · Infrastructure
Each approved experiment runs as an independent service managed by the lab.
The study receives an HTTPS URL such as name.beer-lab.org and oTree administrative access.
The lab configures PostgreSQL, service credentials, and nightly operational backups.
The lab team deploys, updates, and retires the service from an identifiable release.
localhost addresses.02 · Code
Start from the public template and keep the repository root as the oTree project root.
my-experiment/
├── settings.py
├── requirements.txt
├── README.md
├── .gitignore
├── my_app/
│ ├── __init__.py
│ └── ...
├── _static/ # optional
└── _templates/ # optionalDo not nest a second oTree project inside the repository. settings.py must be at its root.
from os import environ
ADMIN_PASSWORD = environ.get('ADMIN_PASSWORD')
SECRET_KEY = environ.get('SECRET_KEY')
# Keep SESSION_CONFIGS, SESSION_CONFIG_DEFAULTS, and ROOMS here.
# The lab supplies DATABASE_URL at deployment.DATABASE_URL, DEBUG, or AUTH_LEVEL inside settings.py.OTREE_, read them with environ.get(), and document their purpose.ROOMS when the operating flow uses room codes or persistent rooms.otree==6.x.y
psycopg2-binary==2.9.10
# add every other dependency actually used belowReplace 6.x.y with the exact version used in testing. Do not include a Procfile, runtime.txt, or Dockerfile; the server builds the runtime.
.venv/
__pycache__/
*.py[cod]
*.sqlite3
.env
.otreezip
.DS_Store
exports/
participant_data/Exclude local databases, exports, participant data, secrets, virtual environments, caches, and large binaries. Discuss videos or other heavy assets before deployment.
03 · Testing
The handoff must work away from the machine on which it was written.
python -m venv .venv
# activate the virtual environment on your system
python -m pip install -r requirements.txt
otree devserverotree testInclude bots for the main paths and every critical branch. Passing automation does not replace a manual walkthrough.
SESSION_CONFIG and, where applicable, enter through every Room.OTREE_PRODUCTION=1 and confirm no local data are required.04 · Technical handoff
Attach a specific technical release to the project record already approved in step 2.
| Item | What to report |
|---|---|
| Release | Repository and tag/commit, or ZIP name and date. |
| Subdomain | A neutral name of 3–15 characters: lowercase letters, numbers, or hyphens; it must start with a letter. |
| Configurations | SESSION_CONFIGS, Rooms, and the flow used for each session type. |
| Operations | Dates, number of sessions, expected simultaneous participants, and pilot window. |
| Variables | Required variable names and purpose. Send secret values separately. |
| Access | The authorized person who should receive the administrative URL and password. |
05 · Publication
The lab builds the identified release; the research team confirms that it behaves like the approved build.
06 · Operations
Use oTree administrative tools as operational controls, not as a replacement for the session protocol.
Sign in through /login; confirm release, configuration, Room, links, capacity, and responsible staff.
Track progress in Monitor, log incidents, and never update the service while participants are connected.
Export data, verify record counts, and store a copy in the approved institutional repository.
07 · Lifecycle
Every deployment must map to a recoverable release and an explicit operating decision.
| Change type | Action |
|---|---|
| Text, styles, or logic without model changes | Supply a new release, document the change, and repeat affected tests. The database can usually be retained. |
| Data fields or models | Schedule a window. oTree may require a database reset; export everything first and validate the new structure. |
| Material study change | Return to the step 2 project record before implementation; further review may be required. |
| End of data collection | Make the final export, verify the files, and tell the lab when the service can be retired. |
For each release, retain the tag or commit, date, owner, change summary, test results, and database decision.
08 · Diagnosis
Most deployment failures come from incomplete dependencies, Windows/Linux differences, or undeclared local files.
| Symptom | Recommended check |
|---|---|
| Installation fails | Confirm every package is in requirements.txt, with a compatible version available for Python 3.11. |
TemplateNotFound | Match capitalization exactly in paths, templates, images, and static files. |
| CSS or images are missing | Check static paths and confirm the files are part of the supplied release. |
| A link points to localhost | Remove hard-coded hosts and construct relative or request-based URLs. |
| Administrative login fails | Confirm ADMIN_PASSWORD comes from the environment and AUTH_LEVEL is not overridden. |
| “Database is out of date” | Stop sessions, export data, and coordinate a reset if the data model changed. |
| Files disappear after an update | Do not write results to service disk; use the database and controlled exports. |
Use this page as the technical checklist. If the design, population, protocol, or any approved condition changes, update the project record before deployment.