I want to put break and continue in my code, but it doesn\'t work in Django template. How can I use continue and break using Django template for loop. Here is an example:
For-loops in Django templates are different from plain Python for-loops, so continue and break will not work in them. See for yourself in the Django docs, there are no break or continue template tags. Given the overall position of Keep-It-Simple-Stupid in Django template syntax, you will probably have to find another way to accomplish what you need.