﻿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
27254	Detect web server context	Jimmy Merrild Krag	nobody	"I have some code in my project that generates some content for my pages (compiles documentation).

I would like this code to run once every time the server starts, and essentially I should use `AppConfig.ready()` to do this. However `AppConfig.ready()` also runs when I run any management command, which is very undesirrable, as I don't want to generate this content every time I run unrelated tasks, such as `migrate`.

Therefore it would be nice to have a flag or some other means to detect if code is currently running in the context a web server or not.

For now I have implemented this as a middleware which throws `MiddlewareNotUsed` after generating the content.
"	New feature	closed	Uncategorized	1.10	Normal	wontfix			Unreviewed	0	0	0	0	0	0
