How capitalize() method works in python/django?
The Django template language is not Python, and is intended to provide restricted access to object methods and suchlike. It's explained in the documentation. item.description.capitalize calls a method capitalize with no arguments. There is no possibility of passing arguments.
It's possible to use the Jinja template language instead of Django's own. Jinja does provide full access to the underlying Python. It's more powerful but less efficient, and most people don't need it (most of the time). [Edit: maybe not more efficient, can't vouch for this, see comments]
It's also possible to write custom filters to do particular things that cannot be expressed in the raw template language. E.g. {{item.description|mycustomfilter:myonearg|...}}
I have read that the method capitalize() is used to change the first letter of a string, from lowercase to uppercase.
I am writing a small website in Django (first time) and I noticed that in the template section if I write item.description.capitalize() I get some error but, removing the parentheses it works, why?
Isn't capitalize a method??