How do I debug Django with Pycharm? Can you print out the data structure of the variable, the details of the structures, similar to the PHP structure? The data structure printed out by print is not detailed.
For example, there is a article data sheet model, I passed article1 = Article.objects.get (id=1), got Article1, and then Print (ARTICLE1), the result is, Can this data structure believe the point again? It doesn't even know if it's a data of your own.
Reply content:
How do I debug Django with Pycharm? Can you print out the data structure of the variable, the details of the structures, similar to the PHP structure? The data structure printed out by print is not detailed.
For example, there is a article data sheet model, I passed article1 = Article.objects.get (id=1), got Article1, and then Print (ARTICLE1), the result is, Can this data structure believe the point again? It doesn't even know if it's a data of your own.
Can directly
print(article1.__dict__)
Print out the properties of the object, and don't know if it solves your problem.
Customizable __str__ method to set print content
See Pycharm Official website Introduction is to support the Django environment debugging. Using the 30-day trial version, is indeed supported, you can set breakpoints, single-step tracking, view variable content and so on.
It is possible to set the assertion directly, I have used it before!