﻿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
35107	How to write a management command that reads from stdin should be documented	Andrew Northall	Richard Zhao	"This seems like a fairly common use case, which is supported by Django, but as far as I can tell no mention of it is made in the documentation. It seems like it should be documented.

For an example of how to do it, `loaddata` and `shell` read from stdin in Django core: 

https://github.com/django/django/blob/main/django/core/management/commands/loaddata.py
https://github.com/django/django/blob/main/django/core/management/commands/shell.py

I hear you say, 'but reading from stdin is a Python feature, not a Django feature, why should we document it?'. In my mind, the documentation as it exists now could lead to confusion: it makes specific mention that you should use `BaseCommand.stdout` and `BaseCommand.stderr` within a management command to write to stdout or stderr. It is not a big jump to then assume that you should also be using `BaseCommand.stdin` (which does not exist) to handle incoming data. The API, in this narrow sense, is inconsistent, and this is why the documentation would be helpful.
"	Cleanup/optimization	closed	Documentation	5.0	Normal	wontfix			Unreviewed	0	0	0	0	0	0
