Tuesday, September 8, 2020

Re: I got this error "ValueError: attempted relative import beyond top-level package "

I followed a tutorial for creating django sitemap, but still got problems along the way. 
I've seen some videos, but didn't work.  
Do you have any references for easy way creating django sitemap for blog posts?
Sure it would help.

Thanks



On Wed, Sep 9, 2020 at 12:02 AM coolguy <cooldjangoprogrammer@gmail.com> wrote:
Not sure why you are importing this into your main project urls.py but its very straight forward

from blog.sitemaps import BlogPostsSitemap

question... are you trying to map the application url here? then you should use path('xxxx/' , Include("blog.urls"))




On Tuesday, September 8, 2020 at 4:39:05 AM UTC-4 hanz...@gmail.com wrote:
Sorry, point no 1 needs to be revised..
1. In urls.py, I want to import BlogPostsSitemap


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0f74b537-3fa8-4725-8098-b602417ea41bn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANV3w%3DaB3ipwfJuJQC-W3c9qq6AruPqqfqnV7ykJ%2BRjAYq1sLw%40mail.gmail.com.

No comments:

Post a Comment