I just need to generate some test content for my template. Something like:
{{ for i < 20 }}
<img src="image-{{i}}.jpg " />
{{ endfor }}
I have no list, how should I proceed?
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.
Well, it stucks up if you don’t have a list or a iterable on template. DJango doesn’t provide a default way to write dummy data. But it does provide
loremtag to get some dummy text. See here.But you can do an exercise though to get working what exactly you are trying to do.
Create a custom templatetag, as
myutilities.pyand add totemplatetagsdirectory of yourapp.Template