Be the first to know about special offers and new products for web developers and Internet business owners.
I will never share your email address with the bad boys. Period.
|
Be the first to know about special offers and new products for web developers and Internet business owners. I will never share your email address with the bad boys. Period.
The latest
Recent comments
|
Use double quotes for {% url %} on Django
Submitted by alexis on Mon, 2008-10-20 15:34.
I recently commented about using the right quotes with Python and simplejson and today I found a similar issue with Django. It happens when using the {% url %} tag on the template system in Django 1.0. {% url %} helps you to avoid hardcoding links and relies on naming your url patterns. Let's suppose we have a url like this in our URLConf:
Now you could insert {% url %} in your template to get the url for a link:
Notice I'm passing the string "abc" using double quotes as the chatroom_data parameter. And here's the important part, these two won't work:
which does not use quotes at all, or this one:
which uses single quotes. The errors may vary depending on how your code works but the fact is to remember that when passing string based parameters to {% url %} you need to always use double quotes. If you're using numbers you could use either no quotes or double quotes. Single quotes will never work. Trackback URL for this post:http://www.ventanazul.com/webzine/trackback/126
|
Want to launch a online store, need a new look for your website, market your services on the Net or build a virtual community? Not a problem, let's talk about it. Where To Host Your Sites? |
Actually it's a common bug:
Actually it's a common bug.
Post new comment