oTree Forum >

Secure room hash changed

#1 by Evan_Calford


What determines the participant hashes for secure rooms? All of my hashes have changed unexpectedly, and I'd like to know how to prevent it from happening again.



#2 by Chris_oTree

That depends on your SECRET_KEY config var (or settings.py setting if you defined that).

#3 by Evan_Calford

Great, thanks. 

So if I am understanding correctly, the SECRET_KEY in settings.py overrides the OTREE_SECRET_KEY in the heroku config vars?

And, if so, I should not include a SECRET_KEY in my settings.py so that the hash will remain fixed across different apps?

#4 by Chris_oTree

OTREE_SECRET_KEY overrides the settings.py setting.
You should keep SECRET_KEY in settings.py since it's still needed in case OTREE_SECRET_KEY is undefined (e.g. when running devserver locally).

#5 by Evan_Calford

Ah, OK. In that case I'm not sure why my hashes changed then, as I had not changed the OTREE_SECRET_KEY.

#6 by Chris_oTree

If OTREE_SECRET_KEY is not defined, oTree Hub sets that env var automatically when you load the 'configure' tab. So if you never loaded that tab before, but then do it later on, that can cause the current situation.

Write a reply

Set forum username