Ticket 23829

This pull requests fixes the actual problem with #23829 and also makes the command work if django.contrib.sites is not installed.

`django.contrib.sites` will default to the current requests to get the domain, but this is not applicable when running as a management command.

I could not find any existing tests for this, so I did not know which tests to enhance. However, I will work on writing some mocks to ensure that the request is being passed correctly.
About the `test_command.py` file: It's not actually test the `ping_google` command. I'd renamed it to `test_utils.py`.

To test the `ping_google` command, see https://github.com/django/django/blob/master/tests/admin_scripts/tests.py#L1665 for example.