#29234 closed Cleanup/optimization (worksforme)
manage.py command "ping_google" requires django.contrib.sites to work but it's not documented
| Reported by: | GOTO Hayato | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | 2.0 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I tried to use ping_google in my Django site with the following command after adding django.contrib.sitemaps to settings.INSTALLED_APPS.
python manage.py ping_google
Then, I got an error like:
django.core.exceptions.ImproperlyConfigured: ping_google requires django.contrib.sites, which isn't installed.
Seeing the related code, it seems that the command requires django.contrib.sites to be installed to work.
def _get_sitemap_full_url(sitemap_url):
if not django_apps.is_installed('django.contrib.sites'):
raise ImproperlyConfigured("ping_google requires django.contrib.sites, which isn't installed.")
https://docs.djangoproject.com/en/2.0/_modules/django/contrib/sitemaps/
I believe it's better to add some notes for this in the documentation.
https://docs.djangoproject.com/en/2.0/ref/contrib/sitemaps/#pinging-google
(This is my first challenge to file an issue here. I'm sorry if I'm missing or misunderstanding anything crucial.)
Change History (2)
follow-up: 2 comment:1 by , 8 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
comment:2 by , 8 years ago
Tim, thank you for your reply. You're right. It was my fault and the current documentation and error message are enough. Thanks for taking a time.
Step 3 of the sitemaps installation is "Make sure you’ve installed the sites framework." so I think another mention of it would be redundant and the error message seems good enough?