Fixed #21832

1st commit: Updates code, tests and docs.
2nd commit: Way to create fk instance at command line.
.. versionadded:: 1.8

You can subclass the management command and override get_input_data() if you want to customize data input and validation. Consult the source code for details on the existing implementation and the method's parameters. For example, it could be useful if you have a ForeignKey in REQUIRED_FIELDS and want to allow creating an instance instead of entering an existing instance's primary key.