Make session survive application restart

This commit is contained in:
Dominik Heidler 2016-03-10 13:57:36 +01:00
parent 5d59a208bb
commit d8bbbf1213
1 changed files with 5 additions and 1 deletions

View File

@ -231,7 +231,11 @@ def register_helpers():
}
app.secret_key = os.urandom(24)
if not os.path.isfile("/var/lib/ffmap/secret_key"):
open("/var/lib/ffmap/secret_key", "wb").write(os.urandom(24))
os.chmod("/var/lib/ffmap/secret_key", 0o600)
app.secret_key = open("/var/lib/ffmap/secret_key", "rb").read()
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True)