The django project-python Django receives an ajax post request error 500 (Internal Server Error)

tags: python web

The error message is as follows:

Clickadd to Shopping Cart The page prompts 500 server error

The error displayed on the terminal is:

Find the role of APPEND_SLASHhttps://www.liurongxing.com/django-append_slash-true.html

It can be seen that it should be a url configuration problem

View the code of the ajax part in urls.py and detail.html

There are two ways to solve the problem

Method 1: The part in the red box above is changed to (recommended)

         

        

Method 2: Change the part in the red box above to

        

        

 

Problem solving ok! ! !

Click again to add shopping cart, success

Intelligent Recommendation

Django uses AJAX 403 error and 500

Problem Description: Today, I am doing a login interface, and the FORM form is submitted, there is no problem, but later I want to use AJAX, then! ! ! ! There is a dead 403 and 500, and then let's tak...

Django ajax post request transmission error distal solution

First plus from form   POST http://127.0.0.1:8000/login/ 403 (Forbidden)   send @ jquery.min.js:6   ajax @ jquery.min.js:6   (anonymous) @ (index):37   dispatch @ jquery.min.js:5   y.handle @ jquery.m...

Ajax reports an error (POST http://192.168.XX.XX:9500/Excursion 500 (Internal Server Error))

Ajax likes to report "POST http://192.168.XX.XX:9500/Excursion 500 (Internal Server Error)" when adding or modifying data Just add the following jQuery statement to the HTML form:...

django DEBUG=False Internal Server Error 500 View the error stack TraceBack method

Add the following content in settings.py With this setting, if the server generates a 500 error, the error message will be printed to the log/screen. You can also set other EMAIL_BACKEND so that the e...

Django ajax post request

Django ajax post request ‘csrfmiddlewaretoken’:‘{{ csrf_token }}’,...

More Recommendation

Error 500 internal server error when thinking of Thinkphp5 on the request server

When using the Vue project to request my Thinkphp5 backend on the Alibaba Cloud server, a 500 error was reported. After checking, it was found that no access permissions were added to the Thinkphp bac...

500 Internal Server Error

  Spring mvc restfull form call api error     As above, this form will report an error....

500 (Internal Server Error)

I encountered this problem today, and was dumbfounded. Then I found it for a long time, tried it for a long time, and finally solved it, writing a blog to commemorate it. First of all, I encountered t...

Internal Server Error 500

Problem analysis: 500, server error, and ajax call is no problem. Solution: By comparing the json object submitted by POST with the object received by the server, it is confirmed that the two objects ...

500 : Internal Server Error

BUG appears: After replacing the production tool, use the Jupyter in Conda, you can load the directory normally, but click on iPyNB: 500: Internal Server Error. Solution Hand: Searching this error on ...

Copyright  DMCA © 2018-2023 - All Rights Reserved - www.programmersought.com  User Notice

Top