How to Solve Django Error: Uncaught SyntaxError:Unexpected token<

I recently built a django + vue project platform. When I was a CV engineer last night, I encountered a bug and the information returned on the page was wrong.

 

The error message on the web page is as follows: Uncaught SyntaxError: Unexpected token< 

 

 

Solution: In the data layer, the operation method of a database is wrong. The original method only needs to be displayed. Currently, it needs to be combined with VUE to realize the real-time display function of the search box. The original variable cannot be traversed, so an error is reported.

 

Code like this

Original code: hrefs = DB_hrefs.obiject.all()

After modification: hrefs = list(DB_hrefs.object.all().values())

 

The problem can be solved after the modification is completed.

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *