I am formatting a string in python and I would like to use one of django’s built in filters that is typically used in a template. Is there an easy way to use it in lines of code?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Depends on the filter. In some cases you can import the module that contains the filter and access a helper function within the module, but in other cases you won’t be so lucky. See the filter source for details.