Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Sitemaps are parsed even if FREEZE_FOLLOW_SITEMAP_URLS = False. #136

Closed
fabiocaccamo opened this issue Sep 21, 2024 Discussed in #135 · 1 comment
Closed

Sitemaps are parsed even if FREEZE_FOLLOW_SITEMAP_URLS = False. #136

fabiocaccamo opened this issue Sep 21, 2024 Discussed in #135 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@fabiocaccamo
Copy link
Owner

fabiocaccamo commented Sep 21, 2024

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.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@fabiocaccamo fabiocaccamo added the bug Something isn't working label Sep 21, 2024
@fabiocaccamo fabiocaccamo moved this to Todo in Open Source Sep 21, 2024
@fabiocaccamo fabiocaccamo self-assigned this Oct 3, 2024
@fabiocaccamo
Copy link
Owner Author

@venteto could you upgrade to 0.11.1 version and give me some feedback about this please?

@github-project-automation github-project-automation bot moved this from Todo to Done in Open Source Oct 3, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

1 participant