Skip to content

Sitemaps are parsed even if FREEZE_FOLLOW_SITEMAP_URLS = False. #136

@fabiocaccamo

Description

@fabiocaccamo

Discussed in #135

Originally posted by venteto September 16, 2024
I'm just trying to get it up and running with a barebones site locally, just to see what the generate_static_site outputs, but it is failing. It seems to be looking for a sitemap. But in settings.py I have added ...

FREEZE_FOLLOW_SITEMAP_URLS = False

... as this is the only mention of sitemaps that I see in your README.

The traceback looks like this:

Traceback (most recent call last):
  File "/vnv/django_static_sites_shared_3_13/lib/python3.13/site-packages/freeze/parser.py", line 31, in parse_sitemap_urls
    sitemap_url = reverse(sitemap_view_name)
  File "/vnv/django_static_sites_shared_3_13/lib/python3.13/site-packages/django/urls/base.py", line 88, in reverse
    return resolver._reverse_with_prefix(view, prefix, *args, **kwargs)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vnv/django_static_sites_shared_3_13/lib/python3.13/site-packages/django/urls/resolvers.py", line 831, in _reverse_with_prefix
    raise NoReverseMatch(msg)
django.urls.exceptions.NoReverseMatch: Reverse for 'django.contrib.sitemaps.views.sitemap' not found. 'django.contrib.sitemaps.views.sitemap' is not a valid view function or pattern name.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/vnv/django_static_sites_shared_3_13/lib/python3.13/site-packages/freeze/parser.py", line 34, in parse_sitemap_urls
    sitemap_url = reverse("sitemap")
  File "/vnv/django_static_sites_shared_3_13/lib/python3.13/site-packages/django/urls/base.py", line 88, in reverse
    return resolver._reverse_with_prefix(view, prefix, *args, **kwargs)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vnv/django_static_sites_shared_3_13/lib/python3.13/site-packages/django/urls/resolvers.py", line 831, in _reverse_with_prefix
    raise NoReverseMatch(msg)
django.urls.exceptions.NoReverseMatch: Reverse for 'sitemap' not found. 'sitemap' is not a valid view function or pattern name.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/run/media/ddg/wmst/msx/sites/django_static_sites/sites/z_unpulished_site/manage.py", line 22, in <module>
    main()
    ~~~~^^
  File "/run/media/ddg/wmst/msx/sites/django_static_sites/sites/z_unpulished_site/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/vnv/django_static_sites_shared_3_13/lib/python3.13/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
    ~~~~~~~~~~~~~~~^^
  File "/vnv/django_static_sites_shared_3_13/lib/python3.13/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/vnv/django_static_sites_shared_3_13/lib/python3.13/site-packages/django/core/management/base.py", line 413, in run_from_argv
    self.execute(*args, **cmd_options)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/vnv/django_static_sites_shared_3_13/lib/python3.13/site-packages/django/core/management/base.py", line 459, in execute
    output = self.handle(*args, **options)
  File "/vnv/django_static_sites_shared_3_13/lib/python3.13/site-packages/freeze/management/commands/generate_static_site.py", line 11, in handle
    scanner.scan(),
    ~~~~~~~~~~~~^^
  File "/vnv/django_static_sites_shared_3_13/lib/python3.13/site-packages/freeze/scanner.py", line 32, in scan
    sitemap_urls = parser.parse_sitemap_urls()
  File "/vnv/django_static_sites_shared_3_13/lib/python3.13/site-packages/freeze/parser.py", line 37, in parse_sitemap_urls
    raise NoReverseMatch(
        f"Reverse for {sitemap_view_name!r} or 'sitemap' not found."
    ) from error
django.urls.exceptions.NoReverseMatch: Reverse for 'django.contrib.sitemaps.views.sitemap' or 'sitemap' not found.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions