<?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>Brandon W. King&#039;s Blog &#187; Python</title>
	<atom:link href="http://www.brandonking.net/blog/tag/python-software-developmentengineering/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brandonking.net/blog</link>
	<description>Blogging about Python, Bioinformatics, Programming, System Administration, Cognitive Science, Philosophy and Life</description>
	<lastBuildDate>Wed, 09 Dec 2009 01:24:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SciPy 2008 &#8211; Software &amp; Tools</title>
		<link>http://www.brandonking.net/blog/2008/08/21/scipy-2008/</link>
		<comments>http://www.brandonking.net/blog/2008/08/21/scipy-2008/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 19:23:45 +0000</pubDate>
		<dc:creator>Brandon W. King</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Software Development/Engineering]]></category>
		<category><![CDATA[scipy]]></category>
		<category><![CDATA[scipy2008]]></category>

		<guid isPermaLink="false">http://blog.brandonking.net/?p=56</guid>
		<description><![CDATA[STATUS:

Day 1 &#8211; Thursday: Concluded.
Day 2 &#8211; Friday: In progress.

Astronomy:

Enzo [ home ]
yt (related to Enzo) [ home &#124; scipy ]

Books:

Computational Modeling and Complexity Science [ home ]
And more at Greentea Press [ home ]

Code Generation &#38; Wrapping:

Cython (based on Pyrex) [ home ]
unPython [ home &#124; scipy ]

Data IO:

PyNIO (NetCDF, HDF 4, etc.) [ [...]]]></description>
			<content:encoded><![CDATA[<p><strong>STATUS:</strong></p>
<ul>
<li>Day 1 &#8211; Thursday: Concluded.</li>
<li>Day 2 &#8211; Friday: In progress.</li>
</ul>
<p><strong>Astronomy:</strong></p>
<ul>
<li>Enzo [ <a href="http://jbpc.ucsd.edu/~jbordner/enzo/">home</a> ]</li>
<li>yt (related to Enzo) [ <a href="http://yt.enzotools.org/">home</a> | <a href="http://conference.scipy.org/abstract?id=6">scipy</a> ]</li>
</ul>
<p><strong>Books:</strong></p>
<ul>
<li>Computational Modeling and Complexity Science [ <a href="http://www.greenteapress.com/compmod/">home</a> ]</li>
<li>And more at Greentea Press [ <a href="http://www.greenteapress.com/">home</a> ]</li>
</ul>
<p><strong>Code Generation &amp; Wrapping:</strong></p>
<ul>
<li>Cython (based on Pyrex) [ <a href="http://cython.org/">home</a> ]</li>
<li>unPython [ <a href="http://code.google.com/p/unpython/">home</a> | <a href="http://conference.scipy.org/abstract?id=7">scipy</a> ]</li>
</ul>
<p><strong>Data IO:</strong></p>
<ul>
<li>PyNIO (NetCDF, HDF 4, etc.) [ <a href="http://www.pyngl.ucar.edu/Nio.shtml">home</a> ]</li>
</ul>
<p><strong>Distributed Computing:</strong></p>
<ul>
<li>IPython1 merged back into IPython! [ <a href="http://ipython.scipy.org/">home</a> ]</li>
</ul>
<p><strong>Documentation:</strong></p>
<ul>
<li>SciPy Documentation Editor [ <a href="http://sd-2116.dedibox.fr/pydocweb/wiki/Front%20Page/">home</a> | <a href="http://conference.scipy.org/abstract?id=1">scipy</a> | slides ]</li>
<li>Sphinx &#8211; Python Documentation Generator [ <a href="http://sphinx.pocoo.org/">home</a> ]</li>
<li>matplotlib solves the riddle of the sphinx [ <a href="http://conference.scipy.org/abstract?id=5">scipy</a> | slides ]</li>
</ul>
<p><strong>Graphs:</strong></p>
<ul>
<li>NetworkX [ <a href="https://networkx.lanl.gov/">home</a> | <a href="http://conference.scipy.org/abstract?id=9">scipy</a> | slides ]</li>
<li>UbiGraph [ <a href="http://ubietylab.net/ubigraph/">home</a> ]</li>
</ul>
<p><strong>Image &amp; Video Processing:</strong></p>
<ul>
<li>LIBCVD (Cambridge Video Dynamics Library) [ <a href="http://mi.eng.cam.ac.uk/~er258/cvd/">home</a> ]</li>
</ul>
<p><strong>Math:</strong></p>
<ul>
<li>Interval [ <a href="http://pyinterval.googlecode.com/">home</a> | <a href="http://conference.scipy.org/abstract?id=12">scipy</a> | slides ]</li>
<li>SAGE [ <a href="http://www.sagemath.org/">home</a> | <a href="http://conference.scipy.org/abstract?id=16">scipy</a> | slides ]</li>
</ul>
<p><strong>Visualization:</strong></p>
<ul>
<li>PyNGL (interface to NCL) [ <a href="http://www.pyngl.ucar.edu/">home</a> ]</li>
<li>Traited VTK [ <a href="https://svn.enthought.com/enthought/wiki/TVTK">home</a> ]</li>
<li>Mayavi2 [ <a href="http://mayavi.sourceforge.net/">home</a> | <a href="http://conference.scipy.org/abstract?id=29">scipy</a> ]</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.brandonking.net/blog/2008/08/21/scipy-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django App + mod_fcgid + Apache 2 Setup on Mac OS X &amp; Debian/Ubuntu Linux</title>
		<link>http://www.brandonking.net/blog/2008/01/31/django-app-mod_fcgid-apache-2-setup-on-mac-os-x-debianubuntu-linux/</link>
		<comments>http://www.brandonking.net/blog/2008/01/31/django-app-mod_fcgid-apache-2-setup-on-mac-os-x-debianubuntu-linux/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 00:54:00 +0000</pubDate>
		<dc:creator>Brandon W. King</dc:creator>
				<category><![CDATA[Computers/IT]]></category>
		<category><![CDATA[Error Fixes]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Systems Administration]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[fcgi]]></category>
		<category><![CDATA[flup]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[mod_fcgid]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[mod_wsgi]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.brandonking.net/?p=34</guid>
		<description><![CDATA[

Update 2008Feb11:
From rather obscure comment from &#8216;apt-cache show python-flup&#8217; on a Debian system, I discovered that flup has been superseded by http://www.modwsgi.org/. It is probably worth checking out mod_wsgi instead of mod_fcgid for Python web applications. Based on the documentation for mod_wsgi integration with Django, I am planning on switching. I will post my results [...]]]></description>
			<content:encoded><![CDATA[<div class="wikipage">
<div id="searchable">
<h2 id="RequiredSoftware">Update 2008Feb11:</h2>
<p>From rather obscure comment from &#8216;apt-cache show python-flup&#8217; on a Debian system, I discovered that flup has been superseded by <a href="http://www.modwsgi.org/">http://www.modwsgi.org/</a>. It is probably worth checking out mod_wsgi instead of mod_fcgid for Python web applications. Based on the documentation for <a href="http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango">mod_wsgi integration with Django</a>, I am planning on switching. I will post my results in a future post.</p>
<h2 id="RequiredSoftware">Required Software<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#RequiredSoftware"><br />
</a></h2>
<ul>
<li>Apache 2 &#8211; <a class="ext-link" href="http://httpd.apache.org/"><span class="icon">http://httpd.apache.org/</span></a></li>
<li>mod_rewrite &#8211; (comes with Apache2)</li>
<li>mod_fcgid &#8211; <a class="ext-link" href="http://fastcgi.coremail.cn/"><span class="icon">http://fastcgi.coremail.cn/</span></a></li>
<li>flup &#8211; <a class="ext-link" href="http://trac.saddi.com/flup"><span class="icon">http://trac.saddi.com/flup</span></a></li>
</ul>
<h2 id="mod_fcgid">mod_fcgid<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#mod_fcgid"><br />
</a></h2>
<h3 id="DownloadSourceandInstall">Download Source and Install<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#DownloadSourceandInstall"><br />
</a></h3>
<ul>
<li><a class="ext-link" href="http://fastcgi.coremail.cn/download.htm"><span class="icon">Download</span></a></li>
</ul>
<p>For reference, here is the mod_fcgid INSTALL.txt&#8230; see my Mac OS X notes below it for changes required to get it working on Mac OS X 10.5 (Leopard):</p>
<pre class="wiki">NOTE: This module is for Apache2 ONLY

UNIXIt's tested on my RedHat8 and Solaris. But it should work on other *NIX platform.NOTE: This module MUST run on share memory supported system

1. If your Apache2 installation isn't in /usr/local/apache2, please edit Makefile and correct it2. cd $mod_fcgid_dir3. make   //in Mac you need Xcode tools, optional install on Install CD4. make install5. add the following line in httpd.conf

LoadModule fcgid_module modules/mod_fcgid.so</pre>
<h4 id="MACOSXNotes">MAC OS X Notes<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#MACOSXNotes"><br />
</a></h4>
<ul>
<li>In Mac OS X Leopard, the Makefile needs to be changed from /usr/local/apache2 to /usr/share/httpd, then steps 3 and 4 above should work.</li>
<li>Step 4 requires: sudo make install</li>
<li>Step 5, you need to add the following to /etc/apache2/httpd.conf: LoadModule fcgid_module libexec/apache2/mod_fcgid.so</li>
<li>IMPORTANT: apache 2 on Mac OS X Leopard is 64-bit and by default, the make file does not build the 64-bit module. To do this, you need to add the following to the Makefile after the EXTRA_CFLAGS option (too far above that will cause it not to work apparently):</li>
</ul>
<pre class="wiki">CFLAGS = -arch ppc -arch ppc64 -arch i386 -arch x86_64</pre>
<p>The above will make a universal binary for all Mac OS X.</p>
<p>If at some point, you get this message either in the error_log or by running &#8216;apachectl configtest&#8217;</p>
<pre class="wiki">httpd: Syntax error on line 117 of /private/etc/apache2/httpd.conf: Cannot load/usr/libexec/apache2/mod_fcgid.so into server:dlopen(/usr/libexec/apache2/mod_fcgid.so, 10): no suitable image found.Did find: /usr/libexec/apache2/mod_fcgid.so: mach-o, but wrong architecture</pre>
<p>Then your mod_fcgid.so module probably was not built with x86_64 architecture&#8230; To check, type</p>
<pre class="wiki">file /usr/libexec/apache2/mod_fcgid.so</pre>
<p>And it should list the architectures that the mod_fcgid.so was built for.</p>
<h3 id="Enablemod_fcgid">Enable mod_fcgid<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#Enablemod_fcgid"><br />
</a></h3>
<h4 id="Linux">Linux<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#Linux"><br />
</a></h4>
<p>At least with Debian/Ubuntu you can enable fcgid by typing (as root):</p>
<pre class="wiki">a2enmod fcgid</pre>
<h4 id="MacOSXLeopard">Mac OS X Leopard (10.5)<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#MacOSXLeopard"><br />
</a></h4>
<p>Add the following to /etc/apache2/httpd.conf:</p>
<pre class="wiki">AddHandler    fcgid-script .fcgiSocketPath    /tmp/fcgid_sockSharememPath  /tmp/fcgid_shmIPCConnectTimeout 20</pre>
<h2 id="mod_rewrite">mod_rewrite<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#mod_rewrite"><br />
</a></h2>
<p>We need to tell apache for what urls it should pass off the request to the fcgi script. This is accomplished with mod_rewrite which is normally turned on by default w/ apache 2 (at least the installations I have seen).</p>
<p>We&#8217;ll start with the full setup required for gaworkflow.frontend, but test it with a &#8220;Hello World&#8221; style dispatch.fcgi script.</p>
<h3 id="gaworkflow.frontendapache2mod_rewritesetup">gaworkflow.frontend apache2 mod_rewrite setup<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#gaworkflow.frontendapache2mod_rewritesetup"><br />
</a></h3>
<h4 id="Linux1">Linux<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#Linux1"><br />
</a></h4>
<p>Add the following to your apache2 /etc/apache2/sites-available/default or other vhost specific file:</p>
<pre class="wiki"># Enable access to the django admin mediaAlias /media /usr/lib/python2.5/site-packages/django/contrib/admin/media

# Turn on the rewrite engineRewriteEngine on

# Enable http:///admin/ and related urlsRewriteRule ^/admin(.*)$ /usr/lib/cgi-bin/dispatch.fcgi/admin$1 [QSA,L]RewriteRule ^/logout(.*)$ /usr/lib/cgi-bin/dispatch.fcgi/logout$1 [QSA,L]RewriteRule ^/login(.*)$ /usr/lib/cgi-bin/dispatch.fcgi/login$1 [QSA,L]</pre>
<h4 id="MacOSXLeopard1">Mac OS X Leopard<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#MacOSXLeopard1"><br />
</a></h4>
<p>Add the following to your apache2 /etc/httpd.conf:</p>
<pre class="wiki"># Enable access to the django admin media# NOTE: the following did not work for me... I had to copy the media directory to#    /Library/WebServer/Documents/media#Alias /media /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/contrib/admin/media/

# Turn on the rewrite engineRewriteEngine on

# Enable http:///admin urlsRewriteRule ^/eland_config(.*)$ /Library/WebServer/CGI-Executables/dispatch.fcgi/eland_config$1 [QSA,L]RewriteRule ^/admin(.*)$ /Library/WebServer/CGI-Executables/dispatch.fcgi/admin$1 [QSA,L]RewriteRule ^/logout(.*)$ /Library/WebServer/CGI-Executables/dispatch.fcgi/logout$1 [QSA,L]RewriteRule ^/login(.*)$ /Library/WebServer/CGI-Executables/dispatch.fcgi/login$1 [QSA,L]</pre>
<h3 id="RestartApache2">Restart Apache 2<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#RestartApache2"><br />
</a></h3>
<h4 id="LinuxDebianUbuntu">Linux (Debian/Ubuntu)<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#LinuxDebianUbuntu"><br />
</a></h4>
<pre class="wiki">sudo /etc/init.d/apache2 restart</pre>
<h4 id="MacOSXLeopard2">Mac OS X Leopard<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#MacOSXLeopard2"><br />
</a></h4>
<pre class="wiki">sudo apachectl restart</pre>
<h2 id="dispatch.fcgi">dispatch.fcgi<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#dispatch.fcgi"><br />
</a></h2>
<h3 id="HelloWorldTest">Hello World Test<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#HelloWorldTest"><br />
</a></h3>
<p>Now to test that we have the mod_fcgid setup properly, create a file called dispatch.fcgi:</p>
<pre class="wiki">#!/usr/bin/python

def myapp(environ, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) return ['Hello World!\n']

if __name__ == '__main__': from flup.server.fcgi import WSGIServer WSGIServer(myapp).run()</pre>
<p>And move it to your cgi-bin directory:</p>
<h4 id="Linuxcgi-bin">Linux cgi-bin<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#Linuxcgi-bin"><br />
</a></h4>
<pre class="wiki">sudo mv dispatch.fcgi /usr/lib/cgi-bin/</pre>
<h4 id="MacOSXLeopardcgi-bin">Mac OS X Leopard cgi-bin<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#MacOSXLeopardcgi-bin"><br />
</a></h4>
<pre class="wiki">sudo mv dispatch.fcgi /Library/WebServer/CGI-Executables/</pre>
<h4 id="LinuxMacOSXFilePermissions">Linux/Mac OS X File Permissions<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#LinuxMacOSXFilePermissions"><br />
</a></h4>
<pre class="wiki">sudo chmod a+x /dispatch.fcgi</pre>
<p>Mac OS X 10.5 users will need to update the Options for  to include +ExecCGI&#8230; by default it is set to &#8220;Options None&#8221;. The updated entry should look like:</p>
<pre class="wiki"> AllowOverride None Options +ExecCGI Order allow,deny Allow from all</pre>
<p><strong>WARNING:</strong> You will get a <strong>message saying &#8220;Forbidden&#8221;</strong> in the web browser if you do not update the directive above.</p>
<h4 id="WebBrowserTest">Web Browser Test<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#WebBrowserTest"><br />
</a></h4>
<p>Point your web browser to <a class="ext-link" href="http://localhost/admin/"><span class="icon">http://localhost/admin/</span></a> and you should see  if it prints &#8220;Hello World!&#8221;. If you see &#8220;Hello World!&#8221; continue to the next section.</p>
<h2 id="InstallingtheDjangodispatch.fcgiscript">Installing the Django App dispatch.fcgi script<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#InstallingtheDjangodispatch.fcgiscript"><br />
</a></h2>
<h3 id="copyofgaworkflowcode">copy of mydjangoapp code<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#copyofgaworkflowcode"><br />
</a></h3>
<p>Make a copy of the mydjangoapp code and database and put it in a location that will be the &#8220;live&#8221; version of the code/database. On Mac OS X, I choose /Library/WebServer/mydjangoapp. Initialize the database like your normally would, but you will need to update the settings.py module so that DATABASE_NAME is an absolute path, otherwise you will get errors in the apache 2 error_log saying that the python code could not connect to the database. Assuming you also choose /Library/WebServer/mydjangoapp, your DATABASE_NAME variable in settings.py should be:</p>
<pre class="wiki">DATABASE_NAME = '/Library/WebServer/mydjangoapp/mydjangoapp.db'</pre>
<p>You will also need to update the settings.py TEMPLATE_DIRS to be an absolute path (relative paths don&#8217;t work for some reason) of &#8220;/Library/WebServer/gaworkflow/templates&#8221;&#8230; so the update version should look like:</p>
<pre class="wiki">TEMPLATE_DIRS = ( "/Library/WebServer/mydjangoapp/templates",)</pre>
<p>Also, you will need to make a link to the admin templates in our /Library/WebServer/mydjangoapp/templates directory by typing:</p>
<p><strong>Mac OS X 10.5:</strong></p>
<pre class="wiki">ln -s /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/contrib/admin/templates/admin /Library/WebServer/mydjangoapp/templates/adminln -s /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/contrib/admin/templates/admin_doc /Library/WebServer/mydjangoapp/templates/admin_docln -s /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/contrib/admin/templates/widget /Library/WebServer/mydjangoapp/templates/widgetln -s /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/contrib/admin/templates/registration /Library/WebServer/mydjangoapp/templates/registration</pre>
<p><span style="font-weight: bold;">Warning: The following directions will tell you how to get past the db read/access errors but may not be the best choice for security&#8230; you consider the possible security issues before following the following instructions.</span></p>
<p>To get the dispatch.fcgi to work properly, I needed to change ownership of /Library/WebServer/mydjangoapp to be owned by the apache2 user, which is _www on Mac OS X 10.5 and www-data on Debian/Ubuntu systems. The the apache user also needs access to the mydjangoapp.db as well. I ran the following commands on Mac OS X 10.5 when placing the files in /Library/WebServer/gaworkflow:</p>
<pre class="wiki">sudo chown _www:_www /Library/WebServer/mydjangoappsudo chown _www:_www /Library/WebServer/mydjangoapp/mydjangoapp.dbsudo chmod o-rwx /Library/WebServer/mydjangoapp/mydjangoapp.dbsudo chmod ug+rwx /Library/WebServer/mydjangoapp/mydjangoapp.db</pre>
<h3 id="newdispatch.fcgi">new dispatch.fcgi<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#newdispatch.fcgi"> ¶</a></h3>
<p>Replace the hello world dispatch.fcgi with the following script:</p>
<pre class="wiki">#!/usr/bin/python                                                            import syssys.path += ['/Library/WebServer/mydjangoapp']from flup.server.fcgi import WSGIServerfrom django.core.handlers.wsgi import WSGIHandlerimport osos.environ['DJANGO_SETTINGS_MODULE'] = 'mydjangoapp.settings'WSGIServer(WSGIHandler()).run()</pre>
<p>You will need to update these two rows:</p>
<ul>
<li>sys.path += ['/Library/WebServer/mydjangoapp']</li>
<li>os.environ['DJANGO_SETTINGS_MODULE'] = &#8216;mydjangoapp.settings&#8217;</li>
</ul>
<p>Where &#8216;/Library/WebServer/gaworkflow should be replaced by PYTHONPATH that would allow your Django package to be imported&#8230; one directory level below the directory containing <span class="underline">init</span>.py.</p>
<p><strong>NOTE:</strong> Make sure you dispatch.fcgi is executable:</p>
<pre class="wiki">sudo chmod a+x dispatch.fcgi</pre>
<p>If everything worked out properly, you should have a working installation of gaworkflow.frontend using mod_fcgid.</p>
<h2 id="TroubleShooting">Trouble Shooting<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#TroubleShooting"><br />
</a></h2>
<ul>
<li>Check apache error logs.</li>
<li>run: sudo apachectl configtest</li>
<li>Check that dispatch.fcgi has #!/usr/bin/python and not #!/usr/bin/env python as that will screw up the environment variables at least w/ Apache 2 that ships on Mac OS 10.5.</li>
<li>run &#8216;python dispatch.fcgi&#8217; to see if you get any standard Python errors.</li>
</ul>
<h3 id="Apache2-error_log--warnmod_fcgid:stderr:OperationalError:unabletoopendatabasefile">Apache2 &#8211; error_log &#8212; [warn] mod_fcgid: stderr: OperationalError: unable to open database file<a class="anchor" title="Link to this section" href="https://woldlab.caltech.edu/cgi-bin/gaworkflow/wiki/FcTrackerApache2#Apache2-error_log--warnmod_fcgid:stderr:OperationalError:unabletoopendatabasefile"><br />
</a></h3>
<p>This means the database is not accessible by the user that is running apache. On Mac OS X 10.5, the user is _www. On Debian/Ubuntu Linux the user is www-data. See the &#8220;copy of gaworkflow code&#8221; section above for directions on changing file permissions for the database.</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.brandonking.net/blog/2008/01/31/django-app-mod_fcgid-apache-2-setup-on-mac-os-x-debianubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bio.scipy.org</title>
		<link>http://www.brandonking.net/blog/2007/09/18/bioscipyorg/</link>
		<comments>http://www.brandonking.net/blog/2007/09/18/bioscipyorg/#comments</comments>
		<pubDate>Tue, 18 Sep 2007 21:34:00 +0000</pubDate>
		<dc:creator>Brandon W. King</dc:creator>
				<category><![CDATA[Bioinformatics]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Software Development/Engineering]]></category>
		<category><![CDATA[bio.scipy.org]]></category>
		<category><![CDATA[biology]]></category>

		<guid isPermaLink="false">http://blog.brandonking.net/?p=32</guid>
		<description><![CDATA[As I said I would do, I am now in the progress of setting up and seeding the biology in python community site, which can be found at bio.scipy.org. Part of the goal, as set at the SciPy 2007 Biology Birds of a Feather (BoF) meeting (organized by Titus Brown), is to establish a community [...]]]></description>
			<content:encoded><![CDATA[<p>As I said I would do, I am now in the progress of setting up and seeding the biology in python community site, which can be found at <a href="http://bio.scipy.org/">bio.scipy.org</a>. Part of the goal, as set at the <a href="http://www.scipy.org/SciPy2007/BioBoFNotes">SciPy 2007 Biology Birds of a Feather (BoF) meeting</a> (organized by Titus Brown), is to establish a community site where anyone using Python in the field of Biology can come together, communicate, share ideas, and share code.</p>
<p>As part of the <a href="http://bio.scipy.org/wiki/index.php/Programming_guide">programming guide</a>, I posted my &#8220;<a href="http://bio.scipy.org/wiki/index.php/Preparing_to_learn_python_guide">Preparing to learn python guide</a>&#8220;, in which, I mention the things about Python I wish I had known when I started learning Python. I am guessing it will be most useful to those who have programmed before in another language and are trying to learn Python.</p>
<p>Also, I  posted a link to <a href="http://swc.scipy.org/">Software Carpentry</a> in the <a href="http://bio.scipy.org/wiki/index.php/Programming_guide">programming guide</a>. Thanks Greg for starting that project!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brandonking.net/blog/2007/09/18/bioscipyorg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SciPy 2007 &#8211; Biology Birds of a Feather meeting</title>
		<link>http://www.brandonking.net/blog/2007/08/17/scipy-2007-biology-birds-of-a-feather-meeting/</link>
		<comments>http://www.brandonking.net/blog/2007/08/17/scipy-2007-biology-birds-of-a-feather-meeting/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 22:18:00 +0000</pubDate>
		<dc:creator>Brandon W. King</dc:creator>
				<category><![CDATA[Bioinformatics]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Software Development/Engineering]]></category>
		<category><![CDATA[biology]]></category>
		<category><![CDATA[scipy]]></category>

		<guid isPermaLink="false">http://blog.brandonking.net/?p=30</guid>
		<description><![CDATA[During the Biology birds of a feather meeting at SciPy 2007, which was organized by Titus Brown, we meet to discuss were those of us using Python for biology/bioinformatics should work together as a community. Two interesting thoughts came up:

Need to establish python/biology community, via website, biology-in-python mailing list, rss, blogs, etc.
Having a core set [...]]]></description>
			<content:encoded><![CDATA[<p>During the Biology birds of a feather meeting at <a href="http://www.scipy.org/SciPy2007">SciPy 2007</a>, which was organized by Titus Brown, we meet to discuss were those of us using Python for biology/bioinformatics should work together as a community. Two interesting thoughts came up:</p>
<ol>
<li>Need to establish python/biology community, via website, <a href="http://lists.idyll.org/listinfo/biology-in-python">biology-in-python mailing list</a>, rss, blogs, etc.</li>
<li>Having a core set of &#8220;interfaces&#8221; for handling basic bioinformatics objects would allow independent projects to share these basic objects. I am sure others will describe this better and in more detail in the near future.</li>
</ol>
<p>I personally believe that even if we only accomplish the first item, it would significantly help the bioinformatics community. I do hope the 2nd is accomplished as well.</p>
<p>What I see is that most people who are new to the python bioinformatics community end up finding <a href="http://www.biopython.org/">BioPython</a>. The only problem is that many people doing bioinformatics with Python who choose not to use BioPython end up doing there own thing an not communicating with the community. The idea here is to make a new python/biology community site were we can communicate, share code, share ideas, etc. In other words support the community as a whole rather than just having communities for individual projects.</p>
<p>I agreed to setup this initial site and seed it information, bioinformatics python packages by category, a place holder for cookbooks, advice for testing and software engineering (referencing  <a href="http://swc.scipy.org/">Greg Wilsion&#8217;s Software Carpentry</a> material, etc.).  I would like to thank <a href="http://enthought.com/">Enthought</a> as they have agreed to host the website. I will add the more information on the community site as it is being setup. We&#8217;ll see how it goes.</p>
<p>Also, check out <a href="http://ivory.idyll.org/blog/aug-07/scipy-biobof.html">Titus Brown&#8217;s Birds of a Feather post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brandonking.net/blog/2007/08/17/scipy-2007-biology-birds-of-a-feather-meeting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
