400 bad request!

Asked 2 years ago, Updated 2 years ago, 50 views

I'm hosting a server at pythonanywhere Below is the address.

http://ssy10011218.pythonanywhere.com/

If you click on comment, it says 400 bad request... I really don't know where it went wrong. If I have to upload the code, I will edit it and upload it. (Crying)

django pythonanywhere

2022-09-21 17:25

1 Answers

The 400 bad request is definitely a problem with the part that sends the request.

Usually, it is a problem that occurs when you choose the wrong location to send a request

When I opened the developer tool and checked it, I was able to confirm that you set the url wrong.

{% url 'add_comment_to_post' pk=post.pk %]  

Not that

{% url 'add_comment_to_post' pk=post.pk %}

That's right.

You can change the brackets at the end to the brackets.


2022-09-21 17:25

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.