0

I am using Django's built-in sitemap feature to dynamically create sitemap. But I keep getting this error, and I don't know why.

Traceback:

File "/home/fancychamps/Django Projects/EduwizardTutorials/EWTEnv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/home/fancychamps/Django Projects/EduwizardTutorials/EWTEnv/lib/python3.5/site-packages/django/core/handlers/base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/fancychamps/Django Projects/EduwizardTutorials/EWTEnv/lib/python3.5/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/fancychamps/Django Projects/EduwizardTutorials/EWTEnv/lib/python3.5/site-packages/django/contrib/sitemaps/views.py", line 16, in inner response = func(request, *args, **kwargs) File "/home/fancychamps/Django Projects/EduwizardTutorials/EWTEnv/lib/python3.5/site-packages/django/contrib/sitemaps/views.py", line 77, in sitemap else site_lastmod.timetuple() AttributeError: 'datetime.time' object has no attribute 'timetuple'

My Code:

class NoteClassSitemap(sitemaps.Sitemap):
    priority = 0.5
    changefreq = 'monthly'

    def items(self):
        return Classes.objects.all().order_by('-date')

    def lastmod(self, obj):
        return obj.date
halfer
  • 19,824
  • 17
  • 99
  • 186
FightWithCode
  • 2,190
  • 1
  • 13
  • 24

0 Answers0