xaralis / django-static-sitemaps

Tool for generating sitemaps as static files to serve them from webserver instead of your Django application.
154 stars 73 forks source link

Version 4.5.0, TemplateDoesNotExist: static_sitemaps/sitemap_index.xml #64

Closed raratiru closed 6 years ago

raratiru commented 6 years ago

Update: I just realized that the new version is only compatible with Django 2.0+. However, Django 1.11 is a LTS release, is this final? Shouldn't it be mentioned at the README file?


After upgrading to version 4.5.0 I receive the following error:

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/path/to/virtualenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/path/to/virtualenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/path/to/virtualenv/lib/python3.5/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/path/to/virtualenv/lib/python3.5/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
   File "/path/to/virtualenv/lib/python3.5/site-packages/static_sitemaps/management/commands/refresh_sitemap.py", line 13, in handle
    generator.write()
  File "/path/to/virtualenv/lib/python3.5/site-packages/static_sitemaps/generator.py", line 80, in write
    self.write_index()
  File "/path/to/virtualenv/lib/python3.5/site-packages/static_sitemaps/generator.py", line 117, in write_index
    output = loader.render_to_string(conf.INDEX_TEMPLATE, {'sitemaps': parts})
  File "/path/to/virtualenv/lib/python3.5/site-packages/django/template/loader.py", line 67, in render_to_string
    template = get_template(template_name, using=using)
  File "/path/to/virtualenv/lib/python3.5/site-packages/django/template/loader.py", line 25, in get_template
    raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: static_sitemaps/sitemap_index.xml

Donwgrading to 4.4.1, the error disappears.

ian-em commented 6 years ago

I believe the package should be compatible with Django 1.11 as well (the small patch for 2.0 support maintains backwards compatibility with older versions).

However it seems the 4.5.0 release is actually missing the template files and doesn't work on any Django version. Version 4.4.1 has a static_sitemaps/templates/ directory but this directory (and the included template files) are missing in the 4.5.0 release on pypi. A new 4.5.1 release is needed with the missing template directory restored into the package.

xaralis commented 6 years ago

@ian-em Thanks for the clarification. I must have made a mistake when releasing 4.5.0. I'm currently out for the holidays, but will try to look into it during the day.

xaralis commented 6 years ago

This should be fixed in https://github.com/xaralis/django-static-sitemaps/releases/tag/4.6.0. Please re-open if it still persists.