I want to cast an int that\'s passed to the template through the url, but it says that the str function isn\'t defined.
str
How do I get around this?
To cast to a string in an expression, you use x|string() instead of str(x).
x|string()
str(x)
string() is an example of a filter, and there are several useful filters that it's worth learning about.
string()