degeist / book-cover-generator

A tool to create user-generated book covers and share on social media.
Other
2 stars 0 forks source link

Django template usage #34

Open avorio opened 8 years ago

avorio commented 8 years ago

You used some nice python templating in the (the blocks) in your upload example. Should we use this more?

Yes, absolutely, whenever it's useful. Have you something specific in mind?

erasmus commented 8 years ago

home.html seems quite big to me. Would love to have:

erasmus commented 8 years ago

Also, want to DRY the code. I keep repeating this long call:

http://res.cloudinary.com/geist/image/upload/l_static:{{ cutout }},c_fit,w_355/l_static:danphil-headline.png,w_400,c_fit,y_10,g_north/l_text:Open%20Sans_40_bold:{{ text|urlencode:"" }},g_south,y_50,w_500,c_fit,co_rgb:FFFFFF/w_500,h_660,c_fill/{{ version_id }}/{{ image_id }}.{{ image_extension }}

which should be stored as a python VAR somewhere.

@avorio can we talk through the basics of how Python defines and uses vars?