﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24994	Document expectations about settings.SECRET_KEY type	Baptiste Mispelon	MaartenPI	"The documentation for SECRET_KEY [1] is not very explicit as to whether it should contain text or bytes.

Using bytes sort of works but can break with cryptic error messages.

From a quick `git grep`, the secret key is used only in two places:

* In `core/signing.py` where it's cast into bytes with `force_bytes()`
* In `utils/crypto.py` where it's `%s` formatted into a unicode string (so Python2 will transparently try to decode it if needed)

We should at least document the exact type we're expecting and I think it would also be worthwhile to add a check to make sure the user's key passes our expectations.

[1] https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SECRET_KEY"	Cleanup/optimization	closed	Documentation	1.8	Normal	fixed			Accepted	1	0	0	0	0	0
