<?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>Lior Gradstein's Blog &#187; python</title>
	<atom:link href="http://www.gradstein.info/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gradstein.info</link>
	<description></description>
	<lastBuildDate>Thu, 13 May 2010 09:46:29 +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>Django: How to find the url/path you&#8217;re into, in a template loaded by a generic view</title>
		<link>http://www.gradstein.info/python/django-how-to-find-the-urlpath-youre-into-in-a-template-loaded-by-a-generic-view/</link>
		<comments>http://www.gradstein.info/python/django-how-to-find-the-urlpath-youre-into-in-a-template-loaded-by-a-generic-view/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 22:11:39 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/?p=197</guid>
		<description><![CDATA[In a Django project, I have a template that is used by two urls, which is quite common (generic views, using &#8216;create_object&#8217; and &#8216;update_object&#8217;). The problem is that I had to add a supplementary menu just when the template is loaded from the &#8216;update&#8217; generic view, and not from the &#8216;create&#8217; generic view.
Making the difference [...]]]></description>
			<content:encoded><![CDATA[<p>In a Django project, I have a template that is used by two urls, which is quite common (generic views, using &#8216;create_object&#8217; and &#8216;update_object&#8217;). The problem is that I had to add a supplementary menu just when the template is loaded from the &#8216;update&#8217; generic view, and not from the &#8216;create&#8217; generic view.</p>
<p>Making the difference between the two urls calls at the template level is a problem because it&#8217;s managed by generic views, so the same template is used.</p>
<p>Anyways, there are several possibilities:</p>
<p>In urls.py, use the <a href="http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-create-update-create-object" class="liexternal">&#8216;template_name&#8217; variable</a>, where you can speficy a specific template for this url(). That is instead of using the default &lt;model&gt;_form.html.<br />
What I don&#8217;t like in this situation, is that I will have two nearly similar templates, just for an added menu. Not cool. Another problem is that I use <a href="http://code.djangoproject.com/wiki/GenerateGenericURLs" class="liexternal">a loop to create all my urls</a>. So if I add a special template, I&#8217;ll add it to <strong>ALL my models</strong> :-(.</p>
<p>Another solution, is to find a way to use a variable in the template that would be different wether the template has been loaded by update_object or create_object.</p>
<p>In our urlpatterns in urls.py, we can use the &#8216;<strong>extra_context</strong>&#8216; variable (takes a <a href="http://docs.djangoproject.com/en/dev/ref/generic-views/?from=olddocs#django-views-generic-create-update-create-object" class="liexternal">dictionnary as parameter</a>). It is correctly managed, even when using generic views. So, you&#8217;ll have :</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">url<span style="color: black;">&#40;</span>r<span style="color: #483d8b;">&#8216;foo/ajouter/$&#8217;</span>, <span style="color: #483d8b;">&#8216;django.views.generic.create_update.create_object&#8217;</span>, &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">dict</span><span style="color: black;">&#40;</span>form_class=modelForm,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extra_context=<span style="color: black;">&#123;</span><span style="color: #483d8b;">&#8216;usage&#8217;</span>:<span style="color: #483d8b;">&#8216;create&#8217;</span><span style="color: black;">&#125;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name=<span style="color: #483d8b;">&#8216;foo_create&#8217;</span>,<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></p>
<p>url<span style="color: black;">&#40;</span>r<span style="color: #483d8b;">&#8216;foo/%s/(?P&lt;object_id&gt;<span style="color: #000099; font-weight: bold;">\d</span>+)/modifier/$&#8217;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">&#8216;django.views.generic.create_update.update_object&#8217;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">dict</span><span style="color: black;">&#40;</span>form_class=modelForm,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extra_context=<span style="color: black;">&#123;</span><span style="color: #483d8b;">&#8216;usage&#8217;</span>:<span style="color: #483d8b;">&#8216;modify&#8217;</span><span style="color: black;">&#125;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name=<span style="color: #483d8b;">&#8216;foo_update&#8217;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div>
<p>We can also use, in urls.py, the <a href="http://docs.djangoproject.com/en/dev/ref/generic-views/?from=olddocs#django-views-generic-create-update-create-object" class="liexternal">&#8216;context_processors&#8217; variable</a>. For more information about the context processors, have <a href="http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/" class="liexternal">a look at this tutorial</a>. The goal is to add &#8216;django.core.context_processors.request&#8217;, like this:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">core</span>.<span style="color: black;">context_processors</span> <span style="color: #ff7700;font-weight:bold;">import</span> request</div>
<p>and in the url(), add context_processors:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">url<span style="color: black;">&#40;</span>r<span style="color: #483d8b;">&#8216;foo/ajouter/$&#8217;</span>, <span style="color: #483d8b;">&#8216;django.views.generic.create_update.create_object&#8217;</span>, &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">dict</span><span style="color: black;">&#40;</span>form_class=modelForm,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; context_processors=<span style="color: black;">&#91;</span>request,<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name=<span style="color: #483d8b;">&#8216;foo_create&#8217;</span>,<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div>
<p>The last possiblity is a more global solution. It&#8217;s like the context_processors usage above, but added into every templates automatically.<br />
To do this, you&#8217;ll have to edit the list of Template Processors in your settings.py file. That list is run each time a template is loaded, and allows one to add any variable to the template automatically. By default (on Django 1.0.x) this list is commented out, so it has by <a href="http://docs.djangoproject.com/en/dev/ref/settings/#setting-TEMPLATE_CONTEXT_PROCESSORS" class="liexternal">default the list</a>:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;django.core.context_processors.auth&quot;</span>,<br />
<span style="color: #483d8b;">&quot;django.core.context_processors.debug&quot;</span>,<br />
<span style="color: #483d8b;">&quot;django.core.context_processors.i18n&quot;</span>,<br />
<span style="color: #483d8b;">&quot;django.core.context_processors.media&quot;</span><span style="color: black;">&#41;</span></div>
<p>You&#8217;ll have to uncomment it, and add &#8216;django.core.context_processors.request&#8217;. By doing this, you get the variable &#8216;request.path&#8217; available in your template.</p>
<p>Finally, you&#8217;ll be able to test your variable with {% ifequal %} and display your conditional elements.</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/django-how-to-find-the-urlpath-youre-into-in-a-template-loaded-by-a-generic-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python snippet to get Mediawiki/Wikipedia Recent Changes externally</title>
		<link>http://www.gradstein.info/python/python-snippet-to-get-mediawikiwikipedia-recent-changes-externally/</link>
		<comments>http://www.gradstein.info/python/python-snippet-to-get-mediawikiwikipedia-recent-changes-externally/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 23:37:35 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[mediawiki]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[rc]]></category>
		<category><![CDATA[recent changes]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[wikipedia]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/?p=94</guid>
		<description><![CDATA[Mediawiki allows one to send Recent Changes (RC) to a UDP port.
The ip address is defined by the variable wgRC2UDPAddress, and the port by the variable wgRC2UDPPort. It&#8217;s a really good idea that it&#8217;s a UDP transfer, since there is no need for any ACK, so Mediawiki doesn&#8217;t block if there is nothing listening on [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mediawiki.org/" class="liexternal">Mediawiki</a> allows one to <a href="http://wikitech.wikimedia.org/view/IRCD" class="liexternal">send Recent Changes</a> (RC) to a UDP port.<br />
The ip address is defined by the variable wgRC2UDPAddress, and the port by the variable wgRC2UDPPort. It&#8217;s a really good idea that it&#8217;s a UDP transfer, since there is no need for any ACK, so Mediawiki doesn&#8217;t block if there is nothing listening on that port.</p>
<p>These parameters must be set in the LocalSettings.php file, like this, for example.</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">$wgRC2UDPAddress = <span style="color: #483d8b;">&#8216;127.0.0.1&#8242;</span>;<br />
$wgRC2UDPPort = <span style="color: #ff4500;">9390</span>;</div>
<p>I wrote a really simple python program (more a proof of concept) that receives the data, cleans it, and then prints it to stdout :</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span><br />
<span style="color: #808080; font-style: italic;"># -*- coding: utf-8 -*-</span><br />
<span style="color: #808080; font-style: italic;">#</span><br />
<span style="color: #808080; font-style: italic;"># vim:syntax=python:sw=4:ts=4:expandtab</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">SocketServer</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span></p>
<p>HOST,PORT = <span style="color: #483d8b;">&#8221;</span>, <span style="color: #ff4500;">9390</span></p>
<p><span style="color: #ff7700;font-weight:bold;">class</span> MyUDPHandler<span style="color: black;">&#40;</span><span style="color: #dc143c;">SocketServer</span>.<span style="color: black;">BaseRequestHandler</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">def</span> handle<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #dc143c;">re</span>.<span style="color: black;">sub</span><span style="color: black;">&#40;</span>r<span style="color: #483d8b;">&#8216;<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\d</span>{0,2}&#8217;</span>, <span style="color: #483d8b;">&#8221;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">request</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span></p>
<p><span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&#8216;__main__&#8217;</span>:<br />
&nbsp; &nbsp;server = <span style="color: #dc143c;">SocketServer</span>.<span style="color: black;">UDPServer</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>HOST, PORT<span style="color: black;">&#41;</span>, MyUDPHandler<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp;server.<span style="color: black;">serve_forever</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div>
<p>I plan to make it into a complete project that will send the data/notifications using Jabber(XMPP).</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.gradstein.info/software/how-to-skip-the-useless-you-are-now-logged-in-page-in-mediawiki/" title="How to skip the useless &#8220;you are now logged in&#8221; page in Mediawiki (January 18, 2009)">How to skip the useless &#8220;you are now logged in&#8221; page in Mediawiki</a> (0)</li>
	<li><a href="http://www.gradstein.info/hardware/how-to-automatically-run-a-script-after-inserting-a-usb-device-on-ubuntu/" title="How to automatically run a script after inserting a USB device on Ubuntu? (April 13, 2008)">How to automatically run a script after inserting a USB device on Ubuntu?</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/python-snippet-to-get-mediawikiwikipedia-recent-changes-externally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to dial a number using Asterisk and Python</title>
		<link>http://www.gradstein.info/python/how-to-dial-a-number-using-asterisk-and-python/</link>
		<comments>http://www.gradstein.info/python/how-to-dial-a-number-using-asterisk-and-python/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 09:39:17 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[voip]]></category>
		<category><![CDATA[clickto dial]]></category>
		<category><![CDATA[dial]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/?p=33</guid>
		<description><![CDATA[I didn&#8217;t find any example in Python on how to Dial a number from an Asterisk server and link it to another channel. So here&#8217;s a quick code to do it. You just need to have a manager defined in your /etc/asterisk/manager.conf defined.
import socket
HOST=&#34;192.168.1.116&#34;
PORT=5038
p = &#34;&#34;&#34;Action: login
Events: off
Username: %(username)s
Secret: %(password)s
Action: originate
Channel: SIP/%(local_user)s
WaitTime: 60
CallerId: 600
Exten: %(phone_to_dial)s
Context: [...]]]></description>
			<content:encoded><![CDATA[<p>I didn&#8217;t find any example in Python on how to Dial a number from an Asterisk server and link it to another channel. So here&#8217;s a quick code to do it. You just need to have a manager defined in your /etc/asterisk/manager.conf defined.</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">socket</span></p>
<p>HOST=<span style="color: #483d8b;">&quot;192.168.1.116&quot;</span><br />
PORT=<span style="color: #ff4500;">5038</span></p>
<p>p = <span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;Action: login<br />
Events: off<br />
Username: %(username)s<br />
Secret: %(password)s</p>
<p>Action: originate<br />
Channel: SIP/%(local_user)s<br />
WaitTime: 60<br />
CallerId: 600<br />
Exten: %(phone_to_dial)s<br />
Context: default<br />
Priority: 1</p>
<p>Action: Logoff<br />
&quot;</span><span style="color: #483d8b;">&quot;&quot;</span><br />
<span style="color: #ff7700;font-weight:bold;">def</span> click_to_call<span style="color: black;">&#40;</span>phone_to_dial, username, password, local_user<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; pattern = p % <span style="color: black;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">&#8216;phone_to_dial&#8217;</span>: phone_to_dial,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">&#8216;username&#8217;</span>: username,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">&#8216;password&#8217;</span>: password,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">&#8216;local_user&#8217;</span>: local_user<span style="color: black;">&#125;</span></p>
<p>&nbsp; &nbsp; s = <span style="color: #dc143c;">socket</span>.<span style="color: #dc143c;">socket</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">socket</span>.<span style="color: black;">AF_INET</span>, <span style="color: #dc143c;">socket</span>.<span style="color: black;">SOCK_STREAM</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; s.<span style="color: black;">connect</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>HOST, PORT<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></p>
<p>&nbsp; &nbsp; data = s.<span style="color: black;">recv</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1024</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> l <span style="color: #ff7700;font-weight:bold;">in</span> pattern.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&#8216;n&#8217;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Sending&gt;&quot;</span>, l<br />
&nbsp; &nbsp; &nbsp; &nbsp; s.<span style="color: black;">send</span><span style="color: black;">&#40;</span>l+<span style="color: #483d8b;">&#8216;rn&#8217;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> l == <span style="color: #483d8b;">&quot;&quot;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data = s.<span style="color: black;">recv</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1024</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> data<br />
&nbsp; &nbsp; data = s.<span style="color: black;">recv</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1024</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; s.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></p>
<p><span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&#8216;__main__&#8217;</span>:<br />
&nbsp; &nbsp; click_to_call<span style="color: black;">&#40;</span>phone_to_dial=<span style="color: #483d8b;">&#8216;123456789&#8242;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; username=<span style="color: #483d8b;">&#8216;manager_login&#8217;</span>, password=<span style="color: #483d8b;">&#8216;yourpass&#8217;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; local_user=<span style="color: #483d8b;">&#8216;600&#8242;</span><span style="color: black;">&#41;</span></div>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.gradstein.info/software/asterisk/asterisk-cirpack-problem-with-free-and-freephonienet/" title="Asterisk cirpack problem with Free and freephonie.net (February 12, 2009)">Asterisk cirpack problem with Free and freephonie.net</a> (0)</li>
	<li><a href="http://www.gradstein.info/software/asterisk/asterisk-dadhi-module-not-working-when-using-xen/" title="Asterisk: DADHI module not working when using Xen (March 26, 2009)">Asterisk: DADHI module not working when using Xen</a> (5)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/how-to-dial-a-number-using-asterisk-and-python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TurboGears and Pylons will merge! (and CleverHarold RIP)</title>
		<link>http://www.gradstein.info/python/turbogears-and-pylons-will-be-merged/</link>
		<comments>http://www.gradstein.info/python/turbogears-and-pylons-will-be-merged/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 15:20:08 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[framework]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/python/turbogears-and-pylons-will-be-merged/</guid>
		<description><![CDATA[Mark Ramm, one of TurboGears&#8217;s core developers announced on TurboGears&#8217;s mailing list that they will merge with Pylons! To be more precise, the API of TurboGears will be implemented on top of Pylons. It seems they already made some test/proof of concept that are, as they say &#8220;a huge success&#8221;. That&#8217;s really good news for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.phptr.com/authors/bio.asp?a=304cff7b-5886-4dcf-ae59-6bbf140dd802&amp;rl=1" class="liexternal">Mark Ramm</a>, one of <a href="http://turbogears.org/" class="liexternal">TurboGears</a>&#8217;s core developers announced on <a href="http://groups.google.com/group/turbogears/browse_thread/thread/d1d2e416023e7033" class="liexternal">TurboGears&#8217;s mailing list</a> that they will merge with <a href="http://pylonshq.com/" class="liexternal">Pylons</a>! To be more precise, the API of TurboGears will be implemented on top of Pylons. It seems they already made some test/proof of concept that are, as they say &#8220;a huge success&#8221;. That&#8217;s really good news for Python web frameworks development, and a good news for me, as I&#8217;ll not have to choose between the two :-</p>
<p>As a sidenote, it seems another framework, <a href="http://www.gradstein.info/python/another-fine-new-web-framework-clever-harold/" class="liinternal">CleverHarold</a> has disappeared without anybody noticing. Its domain is parked, and today its <a href="http://groups.google.com/group/cleverharold" class="liexternal">Google Group page</a> went off (the last messages were from people asking if the project was still alive).</p>
<p><strong>Update:</strong>  <a href="http://www.oreillynet.com/pub/au/3039" class="liexternal">Noah Gift</a><span class="ISI_IGNORE"> wrote a <a href="http://www.oreillynet.com/onlamp/blog/2007/06/python_web_application_framewo.html" class="liexternal">nice article</a> about the merge. </span></p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/turbogears-and-pylons-will-be-merged/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Videos of every presentation of Journée Python 2007 are now online!</title>
		<link>http://www.gradstein.info/python/videos-of-every-presentation-of-journee-python-2007-are-now-online/</link>
		<comments>http://www.gradstein.info/python/videos-of-every-presentation-of-journee-python-2007-are-now-online/#comments</comments>
		<pubDate>Tue, 12 Jun 2007 00:50:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[language]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[twisted]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/language/videos-of-every-presentation-of-journee-python-2007-are-now-online/</guid>
		<description><![CDATA[As the title says it, each presentation was filmed, and has just been uploaded for everyone&#8217;s pleasure! Here is the two-part video presentation of Twisted, done by Michael SCHERER.


Oh, by the way, please take a minute to vote for your favourite Internet Engine!



	Related posts
	
	No related posts.
	

]]></description>
			<content:encoded><![CDATA[<p>As the title says it, each <a href="http://journees.afpy.org/programme" class="liexternal">presentation was filmed</a>, and has just been uploaded for everyone&#8217;s pleasure! Here is the two-part video presentation of Twisted, done by Michael SCHERER.</p>
<p><object type="application/x-shockwave-flash" data="http://video.google.com/googleplayer.swf?docId=8739163173039026567" width="425" height="350" wmode="transparent"><param name="movie" value="http://video.google.com/googleplayer.swf?docId=8739163173039026567" /></object><br />
<object type="application/x-shockwave-flash" data="http://video.google.com/googleplayer.swf?docId=1837647658089311574" width="425" height="350" wmode="transparent"><param name="movie" value="http://video.google.com/googleplayer.swf?docId=1837647658089311574" /></object></p>
<p>Oh, by the way, please take a minute to vote for your favourite Internet Engine!</p>
<p align="center">
<iframe src="http://jyte.com/widget/claim/twistedmatrix.com-is-the-engine-of-your-internet" style="width:400px;height:60px;border:1px solid #777;" scrolling="no"></iframe></p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/videos-of-every-presentation-of-journee-python-2007-are-now-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Journées Python Francophone 2007 Conference at La Villette, France</title>
		<link>http://www.gradstein.info/python/22/</link>
		<comments>http://www.gradstein.info/python/22/#comments</comments>
		<pubDate>Sun, 03 Jun 2007 20:35:17 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/python/22/</guid>
		<description><![CDATA[I went today to the JournÃ©e Python 2007 Conference in France. I managed to see half of the Twisted intro, some lightning talks, and most of the afternoon presentations (thanks to Ido&#8217;s mid-day nap).
Most of the talks were introductory type, but they were finely presented (alas most of the audience already knew python). I hope [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gradstein.info/wp-content/uploads/image5.jpg" class="liimagelink" rel="lightbox"><img src="http://www.gradstein.info/wp-content/uploads/.thumbs/.image5.jpg" alt="Journee Python Conference 2007" align="right" border="0" height="72" width="96" /></a>I went today to the JournÃ©e Python 2007 Conference in France. I managed to see half of the Twisted intro, some lightning talks, and most of the afternoon presentations (thanks to Ido&#8217;s mid-day nap).</p>
<p>Most of the talks were introductory type, but they were finely presented (alas most of the audience already knew python). I hope I&#8217;ll find the time to prepare some more advanced Twisted presentation for next year&#8217;s Conference (there&#8217;s one, right?)</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/22/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nice introduction article on Pylons</title>
		<link>http://www.gradstein.info/python/nice-introduction-article-on-pylons/</link>
		<comments>http://www.gradstein.info/python/nice-introduction-article-on-pylons/#comments</comments>
		<pubDate>Mon, 07 May 2007 08:37:00 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[framework]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/uncategorized/nice-introduction-article-on-pylons/</guid>
		<description><![CDATA[Pylons is a cool web framework (one more, besides TurboGears, Django, Zope, etc.). Someone posted on the mailing list a reference to a nice introduction.

	Related posts
	
	No related posts.
	

]]></description>
			<content:encoded><![CDATA[<p><a href="http://pylonshq.com/" class="liexternal">Pylons</a> is a cool web framework (one more, besides TurboGears, Django, Zope, etc.). Someone posted on the mailing list a reference to a <a href="http://www.rexx.com/%7Edkuhlman/" class="liexternal">nice introduction</a>.</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/nice-introduction-article-on-pylons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Troll of the day: Why Ruby sucks and why Python rocks!</title>
		<link>http://www.gradstein.info/python/troll-of-the-day-why-ruby-sucks-and-why-python-rocks/</link>
		<comments>http://www.gradstein.info/python/troll-of-the-day-why-ruby-sucks-and-why-python-rocks/#comments</comments>
		<pubDate>Wed, 25 Apr 2007 15:06:00 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[twisted]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/uncategorized/troll-of-the-day-why-ruby-sucks-and-why-python-rocks/</guid>
		<description><![CDATA[I found a nicely written article about the problems with Ruby, written by a Ruby user, and why he found Python to be really good. There&#8217;s even a quote about Twisted!
And, there are a bunch of things available to a Python guy that Ruby just canâ€™t compete with that are of particular interest to me. [...]]]></description>
			<content:encoded><![CDATA[<p>I found a <a href="http://blog.cbcg.net/articles/2007/04/22/python-up-ruby-down-if-that-runtime-dont-work-then-its-bound-to-drizzown" class="liexternal">nicely written article</a> about the problems with Ruby, written by a Ruby user, and why he found Python to be really good. There&#8217;s even a quote about Twisted!<br />
<blockquote>And, there are a bunch of things available to a Python guy that Ruby just canâ€™t compete with that are of particular interest to me. Two that come to mind immediately are <a href="http://twistedmatrix.com/trac/" class="liexternal">Twisted</a> and <a href="http://www.stackless.com/" class="liexternal">Stackless Python</a>. The former was used by others at TurnTide for creating a really powerful <span class="caps">SMTP</span> testing tool and the latter was used by TurnTideâ€™s competitor <a href="http://www.ironport.com/" class="liexternal">IronPort</a> to build one of the industryâ€™s best MTAs.</p></blockquote>
<p>I didn&#8217;t knew that IronPort was done in Python, even in Stackless Python!</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/troll-of-the-day-why-ruby-sucks-and-why-python-rocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Apache module for integrating WSGI apps</title>
		<link>http://www.gradstein.info/python/new-apache-module-for-integrating-wsgi-apps/</link>
		<comments>http://www.gradstein.info/python/new-apache-module-for-integrating-wsgi-apps/#comments</comments>
		<pubDate>Tue, 10 Apr 2007 07:05:00 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/uncategorized/new-apache-module-for-integrating-wsgi-apps/</guid>
		<description><![CDATA[Finally, after such painful setups, I really never could find a really suitable configuration that could satisfy me. Here are the different methods I tried to implement TurboGears/Pylons or similar WSGI/Python projects (MoinMoin for example):

FastCGI: So complex to setup, crashes on its own so often, and leaves running processes in memory so have to kill [...]]]></description>
			<content:encoded><![CDATA[<p>Finally, after such painful setups, I really never could find a really suitable configuration that could satisfy me. Here are the different methods I tried to implement <a href="http://www.turbogears.org/" class="liexternal">TurboGears</a>/<a href="http://pylonshq.com/" class="liexternal">Pylons</a> or similar WSGI/Python projects (<a href="http://moinmoin.wikiwikiweb.de/" class="liexternal">MoinMoin </a>for example):</p>
<ul>
<li>FastCGI: So complex to setup, crashes on its own so often, and leaves running processes in memory so have to kill them each time manually to start again with a clean environment. I have to admit it is easier to configure on <a href="http://www.lighttpd.net/" class="liexternal">Lighttpd</a>.</li>
<li><a href="http://www.mems-exchange.org/software/scgi/" class="liexternal">SCGI</a>: As complex as FastCGI and not so used in the world, but not bad. Too few options.</li>
<li>Proxy: Redirecting on a local different port gives nore work, and as soon as you have several other virtual hosts, you&#8217;ll have to keep a registry of all your allocated ports. Painful, but easy to setup. Maybe be hard to configure if you&#8217;re using Zope, and if you need some remote information (ip address of the user for example), you&#8217;re dead!</li>
<li>Direct Access: Configuring you app to run on a local ip alias on your machine and eventually configure your firewall to DNAT on it. Not that complex to setup, but requires access to you OS confiugration and many apps don&#8217;t allow you to only listen on a specific interface (MoinMoin allows it, that&#8217;s cool)</li>
<li>mod_python: Loads Python into memory. Everybody shares the same namespace. Dangerous.</li>
</ul>
<p>Now here&#8217;s a new contender, <a href="http://code.google.com/p/modwsgi/" class="liexternal">mod_wsgi</a> written by <a href="http://blog.dscpl.com.au/" class="liexternal">Graham Dumpleton</a>. That&#8217;s right, it will not work for every app. Zope, not being WSGI aware, is out of the way, except for <a href="http://blog.d2m.at/2006/09/23/zope3-and-wsgi-integration/" class="liexternal">Zope 3.x</a>. But most of Python apps can be modded to be WSGI aware (<a href="http://moinmoin.wikiwikiweb.de/WsgiRequestPatch" class="liexternal">MoinMoin is an example</a>).</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/new-apache-module-for-integrating-wsgi-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PyPy 1.0 has been announced!</title>
		<link>http://www.gradstein.info/python/pypy-10-has-been-announced/</link>
		<comments>http://www.gradstein.info/python/pypy-10-has-been-announced/#comments</comments>
		<pubDate>Wed, 28 Mar 2007 08:08:00 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[language]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/uncategorized/pypy-10-has-been-announced/</guid>
		<description><![CDATA[PyPy version 1.0 is now available. That&#8217;s really a great news, and a milestone for the Python community (and the rest of the programming world). It&#8217;s not yet recommended to use it in production, but we&#8217;re not that far from that.
Please read the announcement and go in the different links referenced there to learn more [...]]]></description>
			<content:encoded><![CDATA[<p>PyPy version 1.0 is now available. That&#8217;s really a great news, and a milestone for the Python community (and the rest of the programming world). It&#8217;s not yet recommended to use it in production, but we&#8217;re not that far from that.</p>
<p>Please read the <a href="http://codespeak.net/pypy/dist/pypy/doc/release-1.0.0.html" class="liexternal">announcement</a> and go in the different links referenced there to learn more about PyPy and what it will change in your life.</p>
<p>Python is so cool.</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/pypy-10-has-been-announced/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
