<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Daniel Banck &#187; Daniel Banck</title>
	<atom:link href="http://dbanck.de/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://dbanck.de</link>
	<description>Webentwicklung - Webdevelopment</description>
	<lastBuildDate>Sat, 09 Jan 2010 00:19:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>POST Data with .net Html Agility Pack</title>
		<link>http://dbanck.de/2010/01/09/post-data-with-net-html-agility-pack/</link>
		<comments>http://dbanck.de/2010/01/09/post-data-with-net-html-agility-pack/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 00:19:53 +0000</pubDate>
		<dc:creator>Daniel Banck</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[post data]]></category>

		<guid isPermaLink="false">http://dbanck.de/?p=111</guid>
		<description><![CDATA[I&#8217;m using the Html Agility Pack for getting and parsing HTML pages. It offers many possibilities, including XPath selectors.
Today I had a problem with posting data to a webpage. It&#8217;s possible to call the HtmlWeb Load function with a second &#8220;POST&#8221; parameter, but it offers no easy way to add values to be posted.
After a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using the <a href="http://htmlagilitypack.codeplex.com/">Html Agility Pack</a> for getting and parsing HTML pages. It offers many possibilities, including XPath selectors.</p>
<p>Today I had a problem with posting data to a webpage. It&#8217;s possible to call the <code>HtmlWeb</code> <code>Load</code> function with a second &#8220;POST&#8221; parameter, but it offers no easy way to add values to be posted.<br />
After a while of searching I came across this solution: add this two functions to the <code>HtmlWeb</code> class. (You can get the source in download section, too)</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> HtmlDocument SubmitFormValues <span style="color: #000000;">&#40;</span>NameValueCollection fv, <span style="color: #FF0000;">string</span> url<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #008080; font-style: italic;">// Attach a temporary delegate to handle attaching</span>
	<span style="color: #008080; font-style: italic;">// the post back data</span>
	PreRequestHandler handler <span style="color: #008000;">=</span> <span style="color: #FF0000;">delegate</span><span style="color: #000000;">&#40;</span>HttpWebRequest request<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #FF0000;">string</span> payload <span style="color: #008000;">=</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">AssemblePostPayload</span> <span style="color: #000000;">&#40;</span>fv<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
			<span style="color: #FF0000;">byte</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> buff <span style="color: #008000;">=</span> Encoding.<span style="color: #0000FF;">ASCII</span>.<span style="color: #0000FF;">GetBytes</span> <span style="color: #000000;">&#40;</span>payload.<span style="color: #0000FF;">ToCharArray</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
			request.<span style="color: #0000FF;">ContentLength</span> <span style="color: #008000;">=</span> buff.<span style="color: #0000FF;">Length</span><span style="color: #008000;">;</span>
			request.<span style="color: #0000FF;">ContentType</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;application/x-www-form-urlencoded&quot;</span><span style="color: #008000;">;</span>
			<span style="color: #000000;">System.<span style="color: #0000FF;">IO</span></span>.<span style="color: #0000FF;">Stream</span> reqStream <span style="color: #008000;">=</span> request.<span style="color: #0000FF;">GetRequestStream</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
			reqStream.<span style="color: #0000FF;">Write</span> <span style="color: #000000;">&#40;</span>buff, <span style="color: #FF0000;">0</span>, buff.<span style="color: #0000FF;">Length</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
			<span style="color: #0600FF;">return</span> true<span style="color: #008000;">;</span>
	<span style="color: #000000;">&#125;</span>
	<span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">PreRequest</span> <span style="color: #008000;">+=</span> handler<span style="color: #008000;">;</span>
	HtmlDocument doc <span style="color: #008000;">=</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Load</span> <span style="color: #000000;">&#40;</span>url, <span style="color: #666666;">&quot;POST&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">PreRequest</span> <span style="color: #008000;">-=</span> handler<span style="color: #008000;">;</span>
	<span style="color: #0600FF;">return</span> doc<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">private</span> <span style="color: #FF0000;">string</span> AssemblePostPayload <span style="color: #000000;">&#40;</span>NameValueCollection fv<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	StringBuilder sb <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StringBuilder <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">String</span> key <span style="color: #0600FF;">in</span> fv.<span style="color: #0000FF;">AllKeys</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		sb.<span style="color: #0000FF;">Append</span> <span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;&amp;&quot;</span> <span style="color: #008000;">+</span> key <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;=&quot;</span> <span style="color: #008000;">+</span> fv.<span style="color: #0000FF;">Get</span> <span style="color: #000000;">&#40;</span>key<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #000000;">&#125;</span>
	<span style="color: #0600FF;">return</span> sb.<span style="color: #0000FF;">ToString</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Substring</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Source: <a href="http://htmlagilitypack.codeplex.com/Thread/View.aspx?ThreadId=14255">http://htmlagilitypack.codeplex.com/Thread/View.aspx?ThreadId=14255</a></p>
<p>Now posting is easy. Example:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">NameValueCollection postData <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> NameValueCollection <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
postData.<span style="color: #0000FF;">Add</span> <span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;name&quot;</span>, <span style="color: #666666;">&quot;value&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
doc <span style="color: #008000;">=</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">hw</span>.<span style="color: #0000FF;">SubmitFormValues</span> <span style="color: #000000;">&#40;</span>postData, url<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>(<code>hw</code> is an <code>HtmlWeb</code> object and <code>doc</code> an <code>HtmlDocument</code> object)</p>
<p>If you need to use cookies, too, you need to modify the <code>HtmlWeb</code> a little more, because there is a little bug.<br />
First add a new <code>private</code> variable:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">private</span> CookieContainer _ck <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> CookieContainer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>Then find this section:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>_useCookies<span style="color: #000000;">&#41;</span> 
<span style="color: #000000;">&#123;</span>
        req.<span style="color: #0000FF;">CookieContainer</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> CookieContainer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>And change it into:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>_useCookies<span style="color: #000000;">&#41;</span> 
<span style="color: #000000;">&#123;</span>
        req.<span style="color: #0000FF;">CookieContainer</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">this</span>._ck<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Now you just have to activate the usage of cookies in your <code>HtmlWeb</code> object:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">hw</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> HtmlWeb <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">hw</span>.<span style="color: #0000FF;">UseCookies</span> <span style="color: #008000;">=</span> true<span style="color: #008000;">;</span></pre></div></div>

<p>That&#8217;s it! Enjoy easy form posting with a full cookie jar (:</p>
]]></content:encoded>
			<wfw:commentRss>http://dbanck.de/2010/01/09/post-data-with-net-html-agility-pack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meine Mitschriften</title>
		<link>http://dbanck.de/2009/10/27/meine-mitschriften/</link>
		<comments>http://dbanck.de/2009/10/27/meine-mitschriften/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 21:21:30 +0000</pubDate>
		<dc:creator>Daniel Banck</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[kiel]]></category>
		<category><![CDATA[uni]]></category>

		<guid isPermaLink="false">http://dbanck.de/?p=107</guid>
		<description><![CDATA[Eine Idee kurzerhand umgesetzt.
Auf http://uni.dbanck.de findet ihr ab heute die meisten meiner Mitschriften der Vorlesungen,
die ich an der Uni Kiel besuche.
Weitere Informationen gibt es auf der Seite. Viel Spaß!
]]></description>
			<content:encoded><![CDATA[<p>Eine Idee kurzerhand umgesetzt.<br />
Auf <a href="http://uni.dbanck.de">http://uni.dbanck.de</a> findet ihr ab heute die meisten meiner Mitschriften der Vorlesungen,<br />
die ich an der Uni Kiel besuche.</p>
<p>Weitere Informationen gibt es auf der Seite. Viel Spaß!</p>
]]></content:encoded>
			<wfw:commentRss>http://dbanck.de/2009/10/27/meine-mitschriften/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Github, Windows and TortoiseGit &#8211; Part 1 Installing &amp; Pulling</title>
		<link>http://dbanck.de/2009/10/08/github-windows-and-tortoisegit-part-1-installing-pulling/</link>
		<comments>http://dbanck.de/2009/10/08/github-windows-and-tortoisegit-part-1-installing-pulling/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 19:37:22 +0000</pubDate>
		<dc:creator>Daniel Banck</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://dbanck.de/?p=82</guid>
		<description><![CDATA[This is a guide for all the Windows users (not me) out there.
It will explain how to work with a github repository under windows using TortoiseGit.
Let&#8217;s get started. At this point you should be a collaborator or owner of a github repository.
Download TortoiseGit from here.
Install it like any other program. There are no special settings, [...]]]></description>
			<content:encoded><![CDATA[<p>This is a guide for all the Windows users (not me) out there.<br />
It will explain how to work with a github repository under windows using TortoiseGit.</p>
<p>Let&#8217;s get started. At this point you should be a collaborator or owner of a github repository.<br />
Download TortoiseGit from <a href="http://code.google.com/p/tortoisegit/">here</a>.<br />
Install it like any other program. There are no special settings, just keep on clicking &#8216;next&#8217;.</p>
<p>Now download msysgit from <a href="http://code.google.com/p/msysgit/">here</a>.<br />
During this installation you have to set some important settings. Please be sure that you set them correctly.</p>
<div id="attachment_83" class="wp-caption alignnone" style="width: 310px"><a href="http://dbanck.de/wp-content/uploads/01_git_install.png"><img src="http://dbanck.de/wp-content/uploads/01_git_install-300x229.png" alt="Adjust the PATH environment" title="Adjust the PATH environment" width="300" height="229" class="size-medium wp-image-83" /></a><p class="wp-caption-text">Adjust the PATH environment</p></div>
<div id="attachment_86" class="wp-caption alignnone" style="width: 310px"><a href="http://dbanck.de/wp-content/uploads/02_git_install.png"><img src="http://dbanck.de/wp-content/uploads/02_git_install-300x229.png" alt="Choose the SSH executable" title="Choose the SSH executable" width="300" height="229" class="size-medium wp-image-86" /></a><p class="wp-caption-text">Choose the SSH executable</p></div>
<div id="attachment_87" class="wp-caption alignnone" style="width: 310px"><a href="http://dbanck.de/wp-content/uploads/03_git_install.png"><img src="http://dbanck.de/wp-content/uploads/03_git_install-300x229.png" alt="Choose line endings" title="Choose line endings" width="300" height="229" class="size-medium wp-image-87" /></a><p class="wp-caption-text">Choose line endings</p></div>
<p>After the successful installation of both programs continue with the generation of private and public SSH-key.<br />
To do this you have to start &#8216;PuTTY Key Generator&#8217; &#8211; find it in Start &#8211; Programs &#8211; TortoiseGit<br />
<div id="attachment_89" class="wp-caption alignnone" style="width: 310px"><a href="http://dbanck.de/wp-content/uploads/04_putty_keygen.png"><img src="http://dbanck.de/wp-content/uploads/04_putty_keygen-300x288.png" alt="Just click &#039;Generate&#039; and move the mouse" title="Putty Keygen" width="300" height="288" class="size-medium wp-image-89" /></a><p class="wp-caption-text">Just click 'Generate' and move the mouse</p></div></p>
<p>After it&#8217;s done you see your freshly generated ssh public key.<br />
You can define a passphrase at this step, but it isn&#8217;t required.<br />
<div id="attachment_90" class="wp-caption alignnone" style="width: 310px"><a href="http://dbanck.de/wp-content/uploads/05_putty_keygen_done.png"><img src="http://dbanck.de/wp-content/uploads/05_putty_keygen_done-300x288.png" alt="Save the public AND private key for later usage." title="Generated public key" width="300" height="288" class="size-medium wp-image-90" /></a><p class="wp-caption-text">Save the public AND private key for later usage.</p></div></p>
<p>You can copy the key out of the box and add it to your github account.<br />
<a href="http://dbanck.de/wp-content/uploads/06_github_key.png"><img src="http://dbanck.de/wp-content/uploads/06_github_key-300x216.png" alt="Add key to github" title="Add key to github" width="300" height="216" class="alignnone size-medium wp-image-91" /></a></p>
<p>Now your ready to create a local repository. Create an empty folder and right-click into it. Choose &#8216;Git Create repository here&#8217;<br />
<a href="http://dbanck.de/wp-content/uploads/06_create_repository.png"><img src="http://dbanck.de/wp-content/uploads/06_create_repository-300x226.png" alt="Create repository" title="Create repository" width="300" height="226" class="alignnone size-medium wp-image-92" /></a></p>
<div id="attachment_93" class="wp-caption alignnone" style="width: 310px"><a href="http://dbanck.de/wp-content/uploads/07_repo_settings.png"><img src="http://dbanck.de/wp-content/uploads/07_repo_settings-300x287.png" alt="Now go to the repository settings" title="Repository Settings" width="300" height="287" class="size-medium wp-image-93" /></a><p class="wp-caption-text">Now go to the repository settings...</p></div>
<div id="attachment_94" class="wp-caption alignnone" style="width: 310px"><a href="http://dbanck.de/wp-content/uploads/08_settings_username.png"><img src="http://dbanck.de/wp-content/uploads/08_settings_username-300x197.png" alt="... and set your username and email that your using at github." title="Set username/email" width="300" height="197" class="size-medium wp-image-94" /></a><p class="wp-caption-text">... and set your full name and email that your using at github.</p></div>
<p><a href="http://dbanck.de/wp-content/uploads/09_settings_remote.png"><img src="http://dbanck.de/wp-content/uploads/09_settings_remote-300x197.png" alt="Config remote" title="Config remote" width="300" height="197" class="alignnone size-medium wp-image-95" /></a><br />
Here you click &#8216;Add New&#8217; and paste the github &#8216;Your Clone URL&#8217; into the url field.<br />
Select the putty private key we created before, too.</p>
<p>Now we&#8217;re ready to pull for the first time.<br />
Select &#8216;Pull&#8217; from the TortoiseGit menu.<br />
<a href="http://dbanck.de/wp-content/uploads/10_pull.png"><img src="http://dbanck.de/wp-content/uploads/10_pull-300x172.png" alt="Pulling" title="Pulling" width="300" height="172" class="alignnone size-medium wp-image-99" /></a><br />
For &#8216;remote&#8217; select the &#8216;origin&#8217; we added before.<br />
Be sure that &#8216;AutoLoad Putty Key&#8217; is checked and for &#8216;Remote Branch&#8217; &#8216;master&#8217; is selected (type it if you can select it).</p>
<p>Now click you and we&#8217;re down.<br />
You should all the repository files now if you did everything correctly.<br />
Part 2 &#8211; Commiting &#038; Merging is coming soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://dbanck.de/2009/10/08/github-windows-and-tortoisegit-part-1-installing-pulling/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bug in cherokee </title>
		<link>http://dbanck.de/2009/07/01/bug-in-cherokee/</link>
		<comments>http://dbanck.de/2009/07/01/bug-in-cherokee/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 19:55:41 +0000</pubDate>
		<dc:creator>Daniel Banck</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[cherokee]]></category>

		<guid isPermaLink="false">http://dbanck.de/?p=80</guid>
		<description><![CDATA[If you&#8217;re trying to use cherokees &#8216;Advanced Virtual Hosting&#8217; and a &#8216;File exists&#8217; rule it will not work.
The rule is not matching any files. Without the AVHosting the rule is working well.
I already reported this bug and it&#8217;s fixed in the latest svn version. So if you need to work with AVHosting and this rule [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re trying to use cherokees &#8216;Advanced Virtual Hosting&#8217; and a &#8216;File exists&#8217; rule it will not work.<br />
The rule is not matching any files. Without the AVHosting the rule is working well.</p>
<p>I already reported this bug and it&#8217;s fixed in the latest svn version. So if you need to work with AVHosting and this rule you better checkout from svn and compile on your own instead of using any precompiled packages.</p>
<p>But I guess in further versions the bugfix will be included.</p>
]]></content:encoded>
			<wfw:commentRss>http://dbanck.de/2009/07/01/bug-in-cherokee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Umstrukturierung</title>
		<link>http://dbanck.de/2009/06/17/umstrukturierung/</link>
		<comments>http://dbanck.de/2009/06/17/umstrukturierung/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 23:57:48 +0000</pubDate>
		<dc:creator>Daniel Banck</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Private]]></category>

		<guid isPermaLink="false">http://dbanck.de/?p=77</guid>
		<description><![CDATA[Da ich nun mit der Schule fertig bin und ab 1.7 anfange zu arbeiten, tritt meine Tätigkeit als Freelancer in den Hintergrund.
Daher gibt es hier auf der Startseite nun auch direkt meinen Blog zu lesen und keine  &#8220;Webentwicklung aus Kiel!&#8221; mehr.
Außerdem werde ich sicherlich regelmäßiger aktiv sein und die Artikel &#8211; je nach Laune [...]]]></description>
			<content:encoded><![CDATA[<p>Da ich nun mit der Schule fertig bin und ab 1.7 anfange zu arbeiten, tritt meine Tätigkeit als Freelancer in den Hintergrund.<br />
Daher gibt es hier auf der Startseite nun auch direkt meinen Blog zu lesen und keine  &#8220;Webentwicklung aus Kiel!&#8221; mehr.</p>
<p>Außerdem werde ich sicherlich regelmäßiger aktiv sein und die Artikel &#8211; je nach Laune &#8211; in Englisch oder Deutsch verfassen.<br />
Dank der simplen Cherokee-Konfiguration wird <code>/blog</code> auch einfach auf <code>/</code> umgeleitet. So landet nichts im Nirwana.</p>
]]></content:encoded>
			<wfw:commentRss>http://dbanck.de/2009/06/17/umstrukturierung/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP and Cherokee</title>
		<link>http://dbanck.de/2009/06/16/cakephp-and-cherokee/</link>
		<comments>http://dbanck.de/2009/06/16/cakephp-and-cherokee/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 12:04:06 +0000</pubDate>
		<dc:creator>Daniel Banck</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[cherokee]]></category>

		<guid isPermaLink="false">http://dbanck.de/?p=60</guid>
		<description><![CDATA[Getting CakePHP working with cherokee is really simple:
First put your CakePHP files into any directory. For me it&#8217;s /home/daniel/Web/dcms
You can delete all the .htaccess files:
/.htaccess
/app/.htaccess
/app/webroot/.htaccess
Add a new virtual host to cherokee, set the document root to the CakePHP webroot:
/home/daniel/Web/dcms/app/webroot
Directory Indexes should be set to index.php
Add a new PHP rule &#8211; with the new wizard it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Getting CakePHP working with cherokee is really simple:</p>
<p>First put your CakePHP files into any directory. For me it&#8217;s <code>/home/daniel/Web/dcms</code><br />
You can delete all the .htaccess files:<br />
<code>/.htaccess<br />
/app/.htaccess<br />
/app/webroot/.htaccess</code></p>
<p>Add a new virtual host to cherokee, set the document root to the CakePHP webroot:<br />
<code>/home/daniel/Web/dcms/app/webroot</code><br />
Directory Indexes should be set to <code>index.php</code></p>
<p>Add a new PHP rule &#8211; with the new wizard it&#8217;s really simple &#8211; and keep the default settings.<br />
Add a new &#8216;file exists&#8217; rule and let it match &#8216;Any File&#8217; and handle it as &#8216;Static Content&#8217;.<br />
<img src="http://dbanck.de/wp-content/uploads/any1.png" alt="Cherokee &#039;Match any file&#039;" title="Cherokee &#039;Match any file&#039;" width="600" height="247" class="alignnone size-full wp-image-68" /><br />
<img src="http://dbanck.de/wp-content/uploads/any2.png" alt="Cherokee &#039;Handle as static content&#039;" title="Cherokee &#039;Handle as static content&#039;" width="600" height="221" class="alignnone size-full wp-image-69" /></p>
<p>How we need to modify the default rule. Change the handler to &#8216;Redirection&#8217; and setup the regex like this:<br />
<img src="http://dbanck.de/wp-content/uploads/any3.png" alt="Cherokee &#039;Default regex&#039;" title="Cherokee &#039;Default regex&#039;" width="599" height="406" class="alignnone size-full wp-image-71" /><br />
(Internal, ^.*$, index.php)</p>
<p>That&#8217;s it!<br />
Just make sure that the rules are in the correct order (php, any file, default):<br />
<img src="http://dbanck.de/wp-content/uploads/any4.png" alt="Cherokee &#039;rule order&#039;" title="Cherokee &#039;rule order&#039;" width="600" height="109" class="alignnone size-full wp-image-72" /></p>
<p>Just save and access CakePHP via your defined domain.<br />
<img src="http://dbanck.de/wp-content/uploads/cake.png" alt="Final result" title="Final result" width="600" height="319" class="alignnone size-full wp-image-74" /></p>
]]></content:encoded>
			<wfw:commentRss>http://dbanck.de/2009/06/16/cakephp-and-cherokee/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Gymnasium Altenholz online!</title>
		<link>http://dbanck.de/2009/01/20/gymnasium-altenholz-online/</link>
		<comments>http://dbanck.de/2009/01/20/gymnasium-altenholz-online/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 15:37:37 +0000</pubDate>
		<dc:creator>Daniel Banck</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://dbanck.de/?p=49</guid>
		<description><![CDATA[Endlich!
Nach einem Jahr Entwicklungsarbeit und zu guter Letzt noch ein paar Problemen beim Transfer der Domain, erstrahlt der Webauftritt des Gymnasium Altenholz’ endlich in einem neuen Licht.
Nun heißt es wohl nur noch: auf die nächsten Bugs warten, hoffen das es nicht zu viele sind und sie schnellstens beheben.
]]></description>
			<content:encoded><![CDATA[<p>Endlich!<br />
Nach einem Jahr Entwicklungsarbeit und zu guter Letzt noch ein paar Problemen beim Transfer der Domain, erstrahlt der Webauftritt des <a href="http://gymnasium-altenholz.de/">Gymnasium Altenholz’</a> endlich in einem neuen Licht.</p>
<p>Nun heißt es wohl nur noch: auf die nächsten Bugs warten, hoffen das es nicht zu viele sind und sie schnellstens beheben.</p>
]]></content:encoded>
			<wfw:commentRss>http://dbanck.de/2009/01/20/gymnasium-altenholz-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Jinja2 with Django</title>
		<link>http://dbanck.de/2009/01/13/using-jinja2-with-django/</link>
		<comments>http://dbanck.de/2009/01/13/using-jinja2-with-django/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 13:55:47 +0000</pubDate>
		<dc:creator>Daniel Banck</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[jinja2]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://dbanck.de/?p=31</guid>
		<description><![CDATA[In the last days I tried to get Jinja2 working with Django.
Here I want to explain a bit about the integration progress.
First we need to install django and jinja2, but I won’t explain it in here, just use easy_install.
After installing you can check if everything works by importing django and jinja2 inside a python shell.
If [...]]]></description>
			<content:encoded><![CDATA[<p>In the last days I tried to get <a href="http://jinja.pocoo.org/2/">Jinja2</a> working with <a href="http://www.djangoproject.com/">Django</a>.<br />
Here I want to explain a bit about the integration progress.</p>
<p>First we need to install django and jinja2, but I won’t explain it in here, just use easy_install.<br />
After installing you can check if everything works by importing django and jinja2 inside a python shell.</p>
<p>If it works we need to create a django project and a example application. (Go for the <a href="http://docs.djangoproject.com/en/dev/intro/tutorial01/#intro-tutorial01">django tutorial</a> if you don’t know how to do this).</p>
<p>Now we need to tell django to use jinja2 to render templates.<br />
The best way to do this is creating a little lib with function to do this which one can import into the views.<br />
So we create inside our project root a directory called libs and there an empty __init__.py file and a file for the jinja2 things.<br />
Lets call it jin.py.</p>
<p>Inside this file we want to create a render_to_response function for jinja2 templates which can be imported from any view.<br />
So here we go:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">http</span> <span style="color: #ff7700;font-weight:bold;">import</span> HttpResponse
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">conf</span> <span style="color: #ff7700;font-weight:bold;">import</span> settings
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">utils</span> <span style="color: #ff7700;font-weight:bold;">import</span> translation
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">core</span>.<span style="color: black;">urlresolvers</span> <span style="color: #ff7700;font-weight:bold;">import</span> get_callable
<span style="color: #ff7700;font-weight:bold;">from</span> jinja2 <span style="color: #ff7700;font-weight:bold;">import</span> FileSystemLoader, Environment, PackageLoader, ChoiceLoader
<span style="color: #ff7700;font-weight:bold;">from</span> functools <span style="color: #ff7700;font-weight:bold;">import</span> wraps
&nbsp;
loader_array = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> pth <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>settings, <span style="color: #483d8b;">'TEMPLATE_DIRS'</span>, <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>:
    loader_array.<span style="color: black;">append</span><span style="color: black;">&#40;</span>FileSystemLoader<span style="color: black;">&#40;</span>pth<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> app <span style="color: #ff7700;font-weight:bold;">in</span> settings.<span style="color: black;">INSTALLED_APPS</span>:
    loader_array.<span style="color: black;">append</span><span style="color: black;">&#40;</span>PackageLoader<span style="color: black;">&#40;</span>app<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
default_mimetype = <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>settings, <span style="color: #483d8b;">'DEFAULT_CONTENT_TYPE'</span><span style="color: black;">&#41;</span>
global_exts = <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>settings, <span style="color: #483d8b;">'JINJA_EXTS'</span>, <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
env = Environment<span style="color: black;">&#40;</span>extensions=global_exts, loader=ChoiceLoader<span style="color: black;">&#40;</span>loader_array<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>This creates the basic jinja2 environment. Notice that it automatically reads the TEMPLATE_DIRS from settings.py and furthermore you can declare inside the settings file which jinja2 extensions should be loaded.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">'jinja2.ext.i18n'</span> <span style="color: #ff7700;font-weight:bold;">in</span> global_exts:
    env.<span style="color: black;">install_gettext_translations</span><span style="color: black;">&#40;</span>translation<span style="color: black;">&#41;</span>
&nbsp;
global_imports = <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>settings, <span style="color: #483d8b;">'JINJA_GLOBALS'</span>, <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> <span style="color: #dc143c;">imp</span> <span style="color: #ff7700;font-weight:bold;">in</span> global_imports:
    method = get_callable<span style="color: black;">&#40;</span><span style="color: #dc143c;">imp</span><span style="color: black;">&#41;</span>
    method_name = <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>method,<span style="color: #483d8b;">'jinja_name'</span>,<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> method_name == <span style="color: #008000;">None</span>:
        env.<span style="color: #008000;">globals</span><span style="color: black;">&#91;</span>method_name<span style="color: black;">&#93;</span> = method
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        env.<span style="color: #008000;">globals</span><span style="color: black;">&#91;</span>method.__name__<span style="color: black;">&#93;</span> = method
&nbsp;
global_filters = <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>settings, <span style="color: #483d8b;">'JINJA_FILTERS'</span>, <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> <span style="color: #dc143c;">imp</span> <span style="color: #ff7700;font-weight:bold;">in</span> global_filters:
    method = get_callable<span style="color: black;">&#40;</span><span style="color: #dc143c;">imp</span><span style="color: black;">&#41;</span>
    method_name = <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>method,<span style="color: #483d8b;">'jinja_name'</span>,<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> method_name == <span style="color: #008000;">None</span>:
        env.<span style="color: black;">filters</span><span style="color: black;">&#91;</span>method_name<span style="color: black;">&#93;</span> = method
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        env.<span style="color: black;">filters</span><span style="color: black;">&#91;</span>method.__name__<span style="color: black;">&#93;</span> = method
&nbsp;
global_tests = <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>settings, <span style="color: #483d8b;">'JINJA_TESTS'</span>, <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> <span style="color: #dc143c;">imp</span> <span style="color: #ff7700;font-weight:bold;">in</span> global_tests:
    method = get_callable<span style="color: black;">&#40;</span><span style="color: #dc143c;">imp</span><span style="color: black;">&#41;</span>
    method_name = <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>method,<span style="color: #483d8b;">'jinja_name'</span>,<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> method_name == <span style="color: #008000;">None</span>:
        env.<span style="color: black;">tests</span><span style="color: black;">&#91;</span>method_name<span style="color: black;">&#93;</span> = method
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        env.<span style="color: black;">tests</span><span style="color: black;">&#91;</span>method.__name__<span style="color: black;">&#93;</span> = method</pre></div></div>

<p>We can also declare the jinja2 globas, filters and tests inside the settings.py via adding:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">JINJA_EXTS = <span style="color: black;">&#40;</span>
    <span style="color: #483d8b;">'jinja2.ext.i18n'</span>,
<span style="color: black;">&#41;</span>
&nbsp;
JINJA_GLOBALS = <span style="color: black;">&#40;</span>
<span style="color: black;">&#41;</span>
&nbsp;
JINJA_FILTERS = <span style="color: black;">&#40;</span>
<span style="color: black;">&#41;</span>
&nbsp;
JINJA_TESTS = <span style="color: black;">&#40;</span>
<span style="color: black;">&#41;</span></pre></div></div>

<p>to it.</p>
<p>So until now our jinja2 environment contains the i18n extension and all other things added in settings.py.<br />
Time to create a render_to_response function.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> render_to_string<span style="color: black;">&#40;</span>filename, context=<span style="color: black;">&#123;</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>:
    template = env.<span style="color: black;">get_template</span><span style="color: black;">&#40;</span>filename<span style="color: black;">&#41;</span>
    rendered = template.<span style="color: black;">render</span><span style="color: black;">&#40;</span><span style="color: #66cc66;">**</span>context<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> rendered
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> render_to_response<span style="color: black;">&#40;</span>filename, context=<span style="color: black;">&#123;</span><span style="color: black;">&#125;</span>, request=<span style="color: #008000;">None</span>, mimetype=default_mimetype<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> request:
        context<span style="color: black;">&#91;</span><span style="color: #483d8b;">'request'</span><span style="color: black;">&#93;</span> = request
        context<span style="color: black;">&#91;</span><span style="color: #483d8b;">'user'</span><span style="color: black;">&#93;</span> = request.<span style="color: #dc143c;">user</span>
    rendered = render_to_string<span style="color: black;">&#40;</span>filename, context<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> HttpResponse<span style="color: black;">&#40;</span>rendered,mimetype=mimetype<span style="color: black;">&#41;</span></pre></div></div>

<p>This function also adds the user object to the context if a request is available.</p>
<p>Inside a view we can to render a template with jinja2:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> libs.<span style="color: black;">jin</span> <span style="color: #ff7700;font-weight:bold;">import</span> render_to_response
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> index<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">return</span> render_to_response<span style="color: black;">&#40;</span><span style="color: #483d8b;">'app_name/index.html'</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Wow. This wasn’t hard, was it?</p>
<p>But you might notice that the user object still isn’t available.<br />
To get the user object back we would need to pass the request object every time to the render_to_response function. That’s really annoying and looks ugly:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">return</span> render_to_response<span style="color: black;">&#40;</span><span style="color: #483d8b;">'app_name/index.html'</span>,<span style="color: black;">&#123;</span><span style="color: black;">&#125;</span>,request<span style="color: black;">&#41;</span></pre></div></div>

<p>So we create a decorator with some more nice features inside our jin.py:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> jin_renderer<span style="color: black;">&#40;</span>prefix=<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> renderer<span style="color: black;">&#40;</span>func<span style="color: black;">&#41;</span>:
        @wraps<span style="color: black;">&#40;</span>func<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">def</span> wrapper<span style="color: black;">&#40;</span>request, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">global</span> default_mimetype
            response = func<span style="color: black;">&#40;</span>request, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>
&nbsp;
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">isinstance</span><span style="color: black;">&#40;</span>response, HttpResponse<span style="color: black;">&#41;</span>:
                <span style="color: #ff7700;font-weight:bold;">return</span> response
            <span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">isinstance</span><span style="color: black;">&#40;</span>response, <span style="color: #008000;">basestring</span><span style="color: black;">&#41;</span>:
                template_name = response
                context_processors = <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span>
                mimetype = default_mimetype
            <span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">isinstance</span><span style="color: black;">&#40;</span>response, <span style="color: black;">&#40;</span><span style="color: #008000;">tuple</span>, <span style="color: #008000;">list</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>:
                len_tuple = <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>response<span style="color: black;">&#41;</span>
                <span style="color: #ff7700;font-weight:bold;">if</span> len_tuple == <span style="color: #ff4500;">2</span>:
                    template_name, context_processors = response
                    mimetype = default_mimetype
                <span style="color: #ff7700;font-weight:bold;">elif</span> len_tuple == <span style="color: #ff4500;">3</span>:
                    template_name, context_processors, mimetype = response
&nbsp;
            <span style="color: #ff7700;font-weight:bold;">if</span> prefix:
                <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">isinstance</span><span style="color: black;">&#40;</span>template_name, <span style="color: black;">&#40;</span><span style="color: #008000;">list</span>, <span style="color: #008000;">tuple</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>:
                    template_name = <span style="color: #008000;">map</span><span style="color: black;">&#40;</span>correct_path, template_name<span style="color: black;">&#41;</span>
                <span style="color: #ff7700;font-weight:bold;">else</span>:
                    template_name = correct_path<span style="color: black;">&#40;</span>template_name<span style="color: black;">&#41;</span>
&nbsp;
            <span style="color: #ff7700;font-weight:bold;">return</span> render_to_response<span style="color: black;">&#40;</span>template_name,context_processors,request,mimetype<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> wrapper
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> correct_path<span style="color: black;">&#40;</span>template_name<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span> template_name.<span style="color: black;">startswith</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/'</span><span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">return</span> template_name<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span>:<span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">'%s%s'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>prefix, template_name<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> renderer</pre></div></div>

<p>When using this renderer the request object is always available and we can also define a template prefix path.<br />
Using this new renderer is very easy, too:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> libs.<span style="color: black;">jin</span> <span style="color: #ff7700;font-weight:bold;">import</span> jin_renderer
&nbsp;
render_to_html = jin_renderer<span style="color: black;">&#40;</span><span style="color: #483d8b;">'app_name/'</span><span style="color: black;">&#41;</span>
&nbsp;
@render_to_html
<span style="color: #ff7700;font-weight:bold;">def</span> index<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">'index.html'</span>,<span style="color: black;">&#123;</span><span style="color: #483d8b;">'test'</span>:<span style="color: #483d8b;">'some context test'</span><span style="color: black;">&#125;</span></pre></div></div>

<p>Now the index.html side your templates/app_name/ will be rendered.</p>
<p>These sites helped me creating the code:<br />
<a href="http://jinja.pocoo.org/2/documentation/">http://jinja.pocoo.org/2/documentation/</a><br />
<a href="http://www.djangosnippets.org/snippets/1112/">http://www.djangosnippets.org/snippets/1112/</a><br />
<a href="http://www.djangosnippets.org/snippets/1061/">http://www.djangosnippets.org/snippets/1061/</a><br />
<a href="http://tinyurl.com/57mojt">http://tinyurl.com/57mojt</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dbanck.de/2009/01/13/using-jinja2-with-django/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>xajax Session Problem</title>
		<link>http://dbanck.de/2008/09/12/xajax-session-problem/</link>
		<comments>http://dbanck.de/2008/09/12/xajax-session-problem/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 14:03:45 +0000</pubDate>
		<dc:creator>Daniel Banck</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://blog.dbanck.de/?p=28</guid>
		<description><![CDATA[Ich nutze für die Cafeteria Website des Gymnasium-Altenholz die xajax Bibliothek. Eigentlich wollte ich nur mal ausprobieren, was damit alles möglich ist, aber es hat mir doch so gut gefallen, dass daraus eine Seite entstanden ist.
Die Seite lief nun seit ca. 1,5 Jahren fehlerfrei, jedoch seit dem Umzug auf einen neuen Server war immer die [...]]]></description>
			<content:encoded><![CDATA[<p>Ich nutze für die <a href="http://cafe.dbanck.de">Cafeteria Website des Gymnasium-Altenholz</a> die <a href="http://xajaxproject.org">xajax</a> Bibliothek. Eigentlich wollte ich nur mal ausprobieren, was damit alles möglich ist, aber es hat mir doch so gut gefallen, dass daraus eine Seite entstanden ist.</p>
<p>Die Seite lief nun seit ca. 1,5 Jahren fehlerfrei, jedoch seit dem Umzug auf einen neuen Server war immer die Session nach dem Neuladen der weg. (Sprich, man war zum Beispiel nicht mehr eingeloggt.) Und dieser Fehler trat plötzlich, ohne jegliche Änderungen am Code auf. Lokal und auf dem alten Server hat ja auch alles einwandfrei funktioniert.</p>
<p>Lange Rede, kurzer Sinn. Nach einer etwa dreitägigen Fehlersuche habe ich die Bibliothek mal auf die neuste Version aktualisiert und siehe da, der Fehler war weg.<br />
Der Kommentar vom Entwickler zur Ursache war dazu:<br />
&#8220;the beta3 release sends an additional header value (it was the user agent IIRC) but php considers it as attack and kills the session.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://dbanck.de/2008/09/12/xajax-session-problem/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wordpress Upgrade to 2.6.2</title>
		<link>http://dbanck.de/2008/09/12/wordpress-upgrade-to-262/</link>
		<comments>http://dbanck.de/2008/09/12/wordpress-upgrade-to-262/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 13:54:41 +0000</pubDate>
		<dc:creator>Daniel Banck</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blog.dbanck.de/?p=21</guid>
		<description><![CDATA[Ich habe soeben ein Wordpress Update auf 2.6.2 vollzogen, auch wenn es nicht unbedingt nötig war. Der Patch behebt eine Schwachstelle, die durch die Nutzung von mt_rand() aufgetreten ist. (Näheres hier)
Update ging soweit schnell und ohne Fehler. Man brauchte nichtmal die wp-admin/upgrade.php.
]]></description>
			<content:encoded><![CDATA[<p>Ich habe soeben ein Wordpress Update auf 2.6.2 vollzogen, auch wenn es nicht unbedingt nötig war. Der Patch behebt eine Schwachstelle, die durch die Nutzung von mt_rand() aufgetreten ist. (Näheres <a href="http://wordpress.org/development/2008/09/wordpress-262/">hier</a>)<br />
Update ging soweit schnell und ohne Fehler. Man brauchte nichtmal die wp-admin/upgrade.php.</p>
]]></content:encoded>
			<wfw:commentRss>http://dbanck.de/2008/09/12/wordpress-upgrade-to-262/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
