Experimental Economics: Data Workflow
oTree: Online Deployment
1 oTree: Online Deployment
1.1 From local to online
- When you test your software you deploy it locally with command
otree devserver
- To deploy it online we need to take the app to an oline server
- We can use the oTree hub or a cloud service
- A possible cloud solution is render.com
- Free with limitations
- Works with Github
- In the past we used Heroku but it is not free anymore
- A possible cloud solution is render.com
2 Github
2.1 Step 1: create a Github account
- Go to github.com and create an account
- Create a new repository
- Name it something like
otree-experiments
- Name is free
3 Render.com
3.1 Step 2: create a render.com account
- I signed in with my existing Github account
- Choose a free plan
- Individual is free but limited
3.2 Step 3a: create a render.com web service
- Create a new web service
- Set properties like in the figure
3.3 Step 3b: create a render.com web service
- Setup environment variables
- Set properties like in the figure
- OTREE_ADMIN_PASSWORD: [here your password]
- OTREE_AUTH_LEVEL: STUDY
- OTREE_PRODUCTION: 1
- PYTHON_VERSION: 3.9.13
4 Github → Render.com
4.1 Step 4: upload your files to Github
- Upload your oTree repository to Github
- App + settings.py +requirements.txt
- Commit your changes
- The process is smoother if you clone the repository on your computer
- Better to use Gitub Desktop to manage the commits
- The process is smoother if you clone the repository on your computer
4.2 Step 5: test your app
- If you go to the webpage
- You should see the app running
- Enter your admin password