Following the PEP 8 rules for Python, you should use spaces before and after operators, for example, x = 1 + 2. I follow this convention, and I don't like it without spaces.
Currently, I'm working on a Django project, and I want to include an HTML document with a keyword.
> {% include "pagination.html" with page = shares %}
If i run it as written above I get a keyword error:
"with" in 'include' tag needs at least one keyword argument.
Without the spaces before and after the = it works without problems. Is that the only way, or is there another way?
There are some cases in which you should not use spaces, like when setting default values to function parameters, or when passing kwargs (keyword arguments), like in your case.
See: https://peps.python.org/pep-0008/#whitespace-in-expressions-and-statements