<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments for Rachel's Blog</title>
	<link>http://www.willmer.com/kb</link>
	<description></description>
	<pubDate>Tue, 19 Aug 2008 21:26:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>Comment on installing mysql5 with php5 on Ubuntu for Wordpress by Jamie Le Souef</title>
		<link>http://www.willmer.com/kb/2007/12/installing-mysql5-with-php5-on-ubuntu-for-wordpress/#comment-26239</link>
		<author>Jamie Le Souef</author>
		<pubDate>Mon, 28 Jul 2008 10:44:25 +0000</pubDate>
		<guid>http://www.willmer.com/kb/2007/12/installing-mysql5-with-php5-on-ubuntu-for-wordpress/#comment-26239</guid>
		<description>That is the quick way to do it - not sure if there are other dependencies to watch out for... Will work. Also, if you want a good way to manage your LAMP setup, check out webmin.. works a treat</description>
		<content:encoded><![CDATA[<p>That is the quick way to do it - not sure if there are other dependencies to watch out for&#8230; Will work. Also, if you want a good way to manage your LAMP setup, check out webmin.. works a treat</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on test.Client problems logging in (now fixed) by Israel</title>
		<link>http://www.willmer.com/kb/2008/07/testclient-problems-logging-in-now-fixed/#comment-26106</link>
		<author>Israel</author>
		<pubDate>Sat, 26 Jul 2008 00:14:55 +0000</pubDate>
		<guid>http://www.willmer.com/kb/2008/07/testclient-problems-logging-in-now-fixed/#comment-26106</guid>
		<description>yeah silly me, 

so basically a manual login without the user entering their password is impossible.

thanks for the clarification</description>
		<content:encoded><![CDATA[<p>yeah silly me, </p>
<p>so basically a manual login without the user entering their password is impossible.</p>
<p>thanks for the clarification</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on test.Client problems logging in (now fixed) by Rachel</title>
		<link>http://www.willmer.com/kb/2008/07/testclient-problems-logging-in-now-fixed/#comment-26024</link>
		<author>Rachel</author>
		<pubDate>Thu, 24 Jul 2008 16:24:33 +0000</pubDate>
		<guid>http://www.willmer.com/kb/2008/07/testclient-problems-logging-in-now-fixed/#comment-26024</guid>
		<description>No, that's not what I'm saying, sorry it was unclear.

AFAICS, the password is not stored in the clear at all, so you cannot get at the cleartext password. You can only verify a given password against the stored hash to say "yes, that's the same."</description>
		<content:encoded><![CDATA[<p>No, that&#8217;s not what I&#8217;m saying, sorry it was unclear.</p>
<p>AFAICS, the password is not stored in the clear at all, so you cannot get at the cleartext password. You can only verify a given password against the stored hash to say &#8220;yes, that&#8217;s the same.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on test.Client problems logging in (now fixed) by israel</title>
		<link>http://www.willmer.com/kb/2008/07/testclient-problems-logging-in-now-fixed/#comment-26023</link>
		<author>israel</author>
		<pubDate>Thu, 24 Jul 2008 16:12:13 +0000</pubDate>
		<guid>http://www.willmer.com/kb/2008/07/testclient-problems-logging-in-now-fixed/#comment-26023</guid>
		<description>Hi, 

i recently ran into this problem, i had created a new user and had sent them an email to verify and authorize their account, but i wanted them to login automatically once the account is verified.  Of course i couldn't use Login() on the user object returned by the authorization because i needed to call authenticate() but to do so i needed username &#38; password, which i could get from the user object, but password never works because it is a hash.

are you saying that if i had used create_user(), calling user.password would return the actual password not the string?</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>i recently ran into this problem, i had created a new user and had sent them an email to verify and authorize their account, but i wanted them to login automatically once the account is verified.  Of course i couldn&#8217;t use Login() on the user object returned by the authorization because i needed to call authenticate() but to do so i needed username &amp; password, which i could get from the user object, but password never works because it is a hash.</p>
<p>are you saying that if i had used create_user(), calling user.password would return the actual password not the string?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Bash: test for undefined variable by Anonymous</title>
		<link>http://www.willmer.com/kb/2007/08/bash-test-for-undefined-variable/#comment-25991</link>
		<author>Anonymous</author>
		<pubDate>Wed, 23 Jul 2008 20:32:41 +0000</pubDate>
		<guid>http://www.willmer.com/kb/2007/08/bash-test-for-undefined-variable/#comment-25991</guid>
		<description>defined()
{
  [ ${!1-X} == ${!1-Y} ]
}

Example:
$ defined FOO &#124;&#124; echo notset
notset
$ FOO=X
$ defined FOO &#124;&#124; echo notset
$ FOO=
$ defined FOO &#124;&#124; echo notset
$ unset FOO
$ defined FOO &#124;&#124; echo notset
notset
$ defined BASH_VERSION[2] &#124;&#124; echo notset
$ defined BASH_VERSION[20] &#124;&#124; echo notset
notset
$</description>
		<content:encoded><![CDATA[<p>defined()<br />
{<br />
  [ ${!1-X} == ${!1-Y} ]<br />
}</p>
<p>Example:<br />
$ defined FOO || echo notset<br />
notset<br />
$ FOO=X<br />
$ defined FOO || echo notset<br />
$ FOO=<br />
$ defined FOO || echo notset<br />
$ unset FOO<br />
$ defined FOO || echo notset<br />
notset<br />
$ defined BASH_VERSION[2] || echo notset<br />
$ defined BASH_VERSION[20] || echo notset<br />
notset<br />
$</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on underwater iPod by martialarts dummy</title>
		<link>http://www.willmer.com/kb/2008/03/underwater-ipod/#comment-25975</link>
		<author>martialarts dummy</author>
		<pubDate>Wed, 23 Jul 2008 15:04:37 +0000</pubDate>
		<guid>http://www.willmer.com/kb/2008/03/underwater-ipod/#comment-25975</guid>
		<description>How often do you yourself swim and what stroke or do you just write about it?

Can I ask though - how did you get this picked up and into google news?

Very impressive that this blog is syndicated through Google and is it something that is just up to Google or you actively created?

Obviously this is a popular blog with great data so well done on your seo success..

Swimming greats you should write about next, my ex was an olympic swimmer!</description>
		<content:encoded><![CDATA[<p>How often do you yourself swim and what stroke or do you just write about it?</p>
<p>Can I ask though - how did you get this picked up and into google news?</p>
<p>Very impressive that this blog is syndicated through Google and is it something that is just up to Google or you actively created?</p>
<p>Obviously this is a popular blog with great data so well done on your seo success..</p>
<p>Swimming greats you should write about next, my ex was an olympic swimmer!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to access the Django request inside a Template Tag by Zack</title>
		<link>http://www.willmer.com/kb/2008/06/how-to-access-the-django-request-inside-a-template-tag/#comment-25739</link>
		<author>Zack</author>
		<pubDate>Fri, 18 Jul 2008 17:45:10 +0000</pubDate>
		<guid>http://www.willmer.com/kb/2008/06/how-to-access-the-django-request-inside-a-template-tag/#comment-25739</guid>
		<description>Thanks for the post, many people talk about using context['request'], but not many tell you about needing
TEMPLATE_CONTEXT_PROCESSORS = ('django.core.context_processors.request',)
to get it to work.

I was using the context to directly get the GET request like: context['urlinfo'], but it didn't work after sending to a flatpage template, but thanks to you its works like a charm, and I can do this context['request'].GET['urlinfo'].

Thanks!</description>
		<content:encoded><![CDATA[<p>Thanks for the post, many people talk about using context[&#8217;request&#8217;], but not many tell you about needing<br />
TEMPLATE_CONTEXT_PROCESSORS = (&#8217;django.core.context_processors.request&#8217;,)<br />
to get it to work.</p>
<p>I was using the context to directly get the GET request like: context[&#8217;urlinfo&#8217;], but it didn&#8217;t work after sending to a flatpage template, but thanks to you its works like a charm, and I can do this context[&#8217;request&#8217;].GET[&#8217;urlinfo&#8217;].</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on &#8220;AttributeError: &#8216;module&#8217; object has no attribute &#8216;blah&#8217;&#8221; by macdet</title>
		<link>http://www.willmer.com/kb/2007/12/attributeerror-module-object-has-no-attribute-blah/#comment-25562</link>
		<author>macdet</author>
		<pubDate>Sun, 13 Jul 2008 13:07:13 +0000</pubDate>
		<guid>http://www.willmer.com/kb/2007/12/attributeerror-module-object-has-no-attribute-blah/#comment-25562</guid>
		<description>Yes, that was mine :( __init__.py

Thx to google and you!</description>
		<content:encoded><![CDATA[<p>Yes, that was mine <img src='http://www.willmer.com/kb/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> __init__.py</p>
<p>Thx to google and you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Fdisk /MBR in Windows XP by nicky81</title>
		<link>http://www.willmer.com/kb/2007/06/fdisk-mbr-in-windows-xp/#comment-25346</link>
		<author>nicky81</author>
		<pubDate>Mon, 07 Jul 2008 20:49:14 +0000</pubDate>
		<guid>http://www.willmer.com/kb/2007/06/fdisk-mbr-in-windows-xp/#comment-25346</guid>
		<description>there are several problems regarding XP booting besides MBR.
including ntldr and pbr</description>
		<content:encoded><![CDATA[<p>there are several problems regarding XP booting besides MBR.<br />
including ntldr and pbr</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to access the Django request inside a Template Tag by Nick</title>
		<link>http://www.willmer.com/kb/2008/06/how-to-access-the-django-request-inside-a-template-tag/#comment-24908</link>
		<author>Nick</author>
		<pubDate>Sun, 22 Jun 2008 21:41:09 +0000</pubDate>
		<guid>http://www.willmer.com/kb/2008/06/how-to-access-the-django-request-inside-a-template-tag/#comment-24908</guid>
		<description>Thanks for the post.

I've found that it's very convinient to use a decorator writing simple line of code like @render_to('mytemplate.html')  instead of passing RequestContext every time like context_instance=RequestContext(request) etc

Here is render_to decorator code. I've found it on internet, so I don't know who is the author.
How to use it:
@render_to('mytemplate.html')
def myview(request):
  return ({'parameter1: 1, 'parameter2':2})

Code:

from django.shortcuts import render_to_response
from django.template import RequestContext

def render_to(template):
    """
    Decorator for Django views that sends returned dict to render_to_response function
    with given template and RequestContext as context instance.

    If view doesn't return dict then decorator simply returns output.
    Additionally view can return two-tuple, which must contain dict as first
    element and string with template name as second. This string will
    override template name, given as parameter

    Parameters:

     - template: template name to use
    """
    def renderer(func):
        def wrapper(request, *args, **kw):
            output = func(request, *args, **kw)
            if isinstance(output, (list, tuple)):
                return render_to_response(output[1], output[0], RequestContext(request))
            elif isinstance(output, dict):
                return render_to_response(template, output, RequestContext(request))
            return output
        return wrapper
    return renderer</description>
		<content:encoded><![CDATA[<p>Thanks for the post.</p>
<p>I&#8217;ve found that it&#8217;s very convinient to use a decorator writing simple line of code like @render_to(&#8217;mytemplate.html&#8217;)  instead of passing RequestContext every time like context_instance=RequestContext(request) etc</p>
<p>Here is render_to decorator code. I&#8217;ve found it on internet, so I don&#8217;t know who is the author.<br />
How to use it:<br />
@render_to(&#8217;mytemplate.html&#8217;)<br />
def myview(request):<br />
  return ({&#8217;parameter1: 1, &#8216;parameter2&#8242;:2})</p>
<p>Code:</p>
<p>from django.shortcuts import render_to_response<br />
from django.template import RequestContext</p>
<p>def render_to(template):<br />
    &#8220;&#8221;"<br />
    Decorator for Django views that sends returned dict to render_to_response function<br />
    with given template and RequestContext as context instance.</p>
<p>    If view doesn&#8217;t return dict then decorator simply returns output.<br />
    Additionally view can return two-tuple, which must contain dict as first<br />
    element and string with template name as second. This string will<br />
    override template name, given as parameter</p>
<p>    Parameters:</p>
<p>     - template: template name to use<br />
    &#8220;&#8221;"<br />
    def renderer(func):<br />
        def wrapper(request, *args, **kw):<br />
            output = func(request, *args, **kw)<br />
            if isinstance(output, (list, tuple)):<br />
                return render_to_response(output[1], output[0], RequestContext(request))<br />
            elif isinstance(output, dict):<br />
                return render_to_response(template, output, RequestContext(request))<br />
            return output<br />
        return wrapper<br />
    return renderer</p>
]]></content:encoded>
	</item>
</channel>
</rss>
