Django Sitemap HTTP Error 500

193 views
Skip to first unread message

dum dum

unread,
Sep 29, 2020, 4:28:05 AM9/29/20
to django...@googlegroups.com

Kasper Laudrup

unread,
Sep 29, 2020, 4:52:09 AM9/29/20
to django...@googlegroups.com
Hi Dum Dum,

On 29/09/2020 10.26, dum dum wrote:
> I'm using django sitemap to generate my sitemap.
>
> In local it works normally, I can visit 127.0.0.1:8000/sitemap.xml
> <http://127.0.0.1:8000/sitemap.xml> and see the data. But in production,
> I got http error 500 (site matching query not exist) when trying to
> access "domain.com/sitemap.xml <http://domain.com/sitemap.xml>". I've
> been following solutions on the internet, and one of those is from this link
>

And as I and others have tried to tell you several times, you can
continue to try random code you find on the internet and hope that the
problem will somehow go away without really knowing why.

That's not a very productive way to write code and just a waste of time.

What you really want to do is to get access to your Django logs where
you most likely have an uncaught exception or something similar pointing
out exactly where the error is and you will most likely be able to fix
it easily.

You do want to be able to access your Django logs in production no
matter what, as this will not be the last time you have an error that
only shows up in production.

Personally I get an email with a full backtrace etc. when an error like
this occurs, which is quite useful in my case, but might not be the
right thing in your case.

If you have problems finding out how to access the logs, then feel free
to ask questions related to that.

Kind regards,

Kasper Laudrup

dum dum

unread,
Sep 29, 2020, 7:43:58 AM9/29/20
to django...@googlegroups.com
Thanks kasper. 

I actually did check the logs many times both local and production, nothing is wrong,, I use:
heroku logs --tail -a -myapp on my production environment

All runs smoothly, except when I visit domain.com/sitemap.xml, I got this error. 
Because this is the main reason I requested help. I did my best to search the solution though.

2020-09-29T11:31:08.535970+00:00 app[web.1]: /*some numbers */ - - [29/Sep/2020:18:31:08 +0700] "GET /sitemap.xml HTTP/1.1" 500 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36"
2020-09-29T11:31:08.540679+00:00 heroku[router]: at=info method=GET path="/sitemap.xml" host=jawaban.online request_id=(/*some random string*/) fwd="(/*some numbers*/)" dyno=web.1 connect=0ms service=643ms status=500 bytes=286 protocol=http

I also realized that in the log, there are robots crawling my website. Since I have links left to be crawled.

But for newer links in my site, the robot wouldn't find it because this error.

image.png
pic above is from my google search console..
image.png
this one is from bing webmaster.

Actually I did successfully submitted the sitemap before. But now I got this error suddenly.

Thanks.



--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/016ab31a-8b9d-13fd-959f-06bbf4a1930c%40stacktrace.dk.

Kasper Laudrup

unread,
Sep 29, 2020, 8:14:27 AM9/29/20
to django...@googlegroups.com
Hi Dum Dum,

On 29/09/2020 13.42, dum dum wrote:
> Thanks kasper.
>
> I actually did check the logs many times both local and production,
> nothing is wrong,, I use:
> heroku logs --tail -a -myapp on my production environment
>

It looks like this is only bringing up the access logs, which is not
really all that useful. And something is wrong in the logs. I would
definitely consider a 500 Interal Server errors as "something wrong".

There must be some way to get some more detailed logs from your Django
application.

I have zero experience with Heroku which seems to be what you are using,
but maybe someone else has an idea on how to access the relevant logs
there? I think this question has been asked and answered here before.

I can only refer to the Django documentation on logging:

https://docs.djangoproject.com/en/3.1/topics/logging/

Kind regards,

Kasper Laudrup

Dvs Khamele

unread,
Oct 11, 2020, 1:37:16 PM10/11/20
to django...@googlegroups.com, hanz...@gmail.com
Hi do you hire contract based python/django freelancer?
We can help you in this and related techincal tasks at fair prices. Reply or send email to div...@pythonmate.com
Best Regards, 
Divyesh Khamele,
Pythonmate


--
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages