If you choose to deploy oTree project from your local folder, the process is following:
- Open cmd.exe or Terminal in a folder where your project is extracted. You should be in folder where file settings.py is. For example now I can list my otree folders using:
2. If you don’t have otree installed, install it with:
python3 -m pip otree
3. Create .otreezip archive using:
otree zip
After this step, you should have yourproject.otreezip file in the folder (instead of yourproject will be your project’s name).
4. In your browser, go to otreehub.com, Login with otreehub account and then select Heroku server deployment:
5. In the Heroku Projects In the Active Sites click to Deploy
6. In the Deploy page, Click to Choose File and select the .otreezip file we generated in step 3 and click Upload. The Build will start below and shows Build Progress for few minutes. Eventually build indicator should turn green and show Your build succeeded.
7. When the build finishes, the last step is to Reset the DB – this will erase stored questionary results, but its necessary when we updated the structure of site, like add a new Form field. Click to Reset DB. It would require confirmation, that you know that all will be erased. Click OK there. Then it will show the DB Deployment progress similar way like with Build above, it would have several lines.
8. When you get State changed from Up to complete on last line, that is the indication that all proceeded successfully. Now we are done.
You can now open your newly deployed page. The link is displayed in the top of the Deployment page in last line of First time setting up this project? In the fourth step. Click on it to open your new Questionary on Heroku.