Update README.md

This commit is contained in:
PV Tejas 2023-07-11 10:04:58 +00:00
parent 16fd17829a
commit 199d19a7bf

View file

@ -9,3 +9,8 @@ Use `flask --app flaskr run` to run app. To update package, you will need to ins
## Initializing database
The first time you install the app in each environment, you need to initialize database using `flask --app flaskr init-db`. This only needs to be run once per environment, and **will delete existing database if run again**.
## Secret key
Every website with login needs a secret key to hash passwords with.
`<python_environment>/var/flaskr-instance/config.py` must contain a line `SECRET_KEY = '<secret_key>`, which must be randomly generated.
Suggested way of generating the key is `python -c 'import secrets; print(secrets.token_hex())'`, which returns a hexadecimal string with length 64. You may choose to randomly generate a key using a different method, but ensure that it is resistant to brute-force attacks.