Realistically the user never needs to care about the secret key, it can be auto-generated during the first run. I think it makes sense to put it in the database and not the file system because that way if you use a distributed database backend like cockroachDb every node gets the same secret key and everything sort of just works.
import secrets
secret_key=secrets.token_urlsafe(50)
Is part of the standard library.
Just removes a little bit more friction when people set up the service for the first time.
Realistically the user never needs to care about the secret key, it can be auto-generated during the first run. I think it makes sense to put it in the database and not the file system because that way if you use a distributed database backend like cockroachDb every node gets the same secret key and everything sort of just works.
Is part of the standard library.
Just removes a little bit more friction when people set up the service for the first time.