Archive

Posts Tagged ‘django’

Presentation on basics of Django

May 1, 2011 Leave a comment

I did a presentation on basics of Django in chennai python user group (chennaipy) meeting last week. This post contains the presentation and code samples i used in the talk.

The presentation and code samples were designed to help Django newbies.  There are some differences in  the code i used in the presentation and the actual code samples , also i was not able to get the alignment of python code correct in the presentation.

The presentation can be downloaded from here

The code samples and source of the presentation (latex-beamer) are available under GNU Free documentation license  https://gitorious.org/saga-presentations . Feel free to modify them for your own needs 🙂

Advertisement

Django , Interpolate two strings in a template

April 15, 2011 Leave a comment

While i was working on my weekend project http://downloader.zer0c00l.in/,  I had to concat  interpolate two strings inside a template,  first string was hard coded in the template and another one had to be passed from the view. Initially i tried something like

<a href="/view/logs/?page="{{ page }}> next </a>

That resulted in <a href=”/view/logs/?page=”>next</a> .  Django completely ignored the {{ page }}. After scratching my head for a long time i removed the quotes and rewrote the code into

<a href=/view/logs/?page={{ page }}> next </a>

That worked as expected.

Categories: django, fedora, foss, fun, python, webdev Tags: ,