<?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>LinuxMonk &#187; Python</title>
	<atom:link href="http://www.linuxmonk.org/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxmonk.org</link>
	<description>A Journey Towards Infinity...</description>
	<lastBuildDate>Fri, 16 Jul 2010 19:32:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Deploying Django in Apache using mod_wsgi</title>
		<link>http://www.linuxmonk.org/2009/06/27/deploying-django-in-apache-using-mod_wsgi/</link>
		<comments>http://www.linuxmonk.org/2009/06/27/deploying-django-in-apache-using-mod_wsgi/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 15:12:17 +0000</pubDate>
		<dc:creator>Rosario</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://www.linuxmonk.org/?p=293</guid>
		<description><![CDATA[Deploying Django in Apache using mod_wsgi is the most recommended one when compared to using mod_python. Deploying Django in apache is not very difficult, its simple with quite simple steps. Here i have created a helloworld project and explained how to deploy it in apache. You must install mod_wsgi apache module before trying this. Step [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom: 0in;">Deploying Django in Apache using mod_wsgi is the most recommended one when compared to using mod_python. Deploying Django in apache is not very difficult, its simple with quite simple steps. Here i have created a helloworld project and explained how to deploy it in apache. You must install mod_wsgi apache module before trying this.</p>
<p style="margin-bottom: 0in;"><strong>Step 1:</strong> Create an directory named apache in your project directory. And add two files one for conf and another a wsgi application in it.</p>
<blockquote>
<p style="margin-bottom: 0in;">$mkdir apache</p>
<p style="margin-bottom: 0in;">$cd apache</p>
<p style="margin-bottom: 0in;">$touch apache_django_wsgi.conf</p>
<p style="margin-bottom: 0in;">$touch dj_hello.wsgi</p>
</blockquote>
<p style="margin-bottom: 0in;"><strong>Step 2: </strong>Open the apache_django_wsgi.conf file with a text editor(gedit)and add the following contents</p>
<p style="margin-bottom: 0in;">
<blockquote>
<p style="margin-bottom: 0in;">WSGIScriptAlias /dj &#8220;/path/to/us/project/folder/helloworld/apache/dj_hello.wsgi&#8221;</p>
<p style="margin-bottom: 0in;">&lt;Directory &#8220;/path/to/ur/project/folder/helloworld/apache&#8221;&gt;</p>
<p style="margin-bottom: 0in;">Allow from all</p>
<p style="margin-bottom: 0in;">&lt;/Directory&gt;</p>
</blockquote>
<p style="margin-bottom: 0in;">Here, helloworld is the name of the project</p>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;"><strong>Step 3:</strong> Open the dj_hello.wsgi with a text editor(gedit) and add the following contents</p>
<blockquote>
<p style="margin-bottom: 0in;">import os, sys</p>
<p style="margin-bottom: 0in;">#Calculate the path based on the location of the WSGI script.</p>
<p style="margin-bottom: 0in;">apache_configuration= os.path.dirname(__file__)</p>
<p style="margin-bottom: 0in;">project = os.path.dirname(apache_configuration)</p>
<p style="margin-bottom: 0in;">workspace = os.path.dirname(project)</p>
<p style="margin-bottom: 0in;">sys.path.append(workspace)</p>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;">#Add the path to 3rd party django application and to django itself.</p>
<p style="margin-bottom: 0in;">sys.path.append(&#8216;/usr/lib/python2.5/site-packages/django/&#8217;)</p>
<p style="margin-bottom: 0in;">os.environ['DJANGO_SETTINGS_MODULE'] = &#8216;helloworld.settings&#8217;</p>
<p style="margin-bottom: 0in;"># project settings file</p>
<p style="margin-bottom: 0in;">import django.core.handlers.wsgi</p>
<p style="margin-bottom: 0in;">application = django.core.handlers.wsgi.WSGIHandler()</p>
<p style="margin-bottom: 0in;"><strong><br />
</strong></p>
</blockquote>
<p style="margin-bottom: 0in;"><strong>Step 4:</strong> Put an entry in your apache configuration fine (httpd.conf or apache2.conf depending upon the destro you are using)</p>
<blockquote>
<p style="margin-bottom: 0in;">Include &#8220;/path/to/ur/project/folder/helloworld/apache/apache_django_wsgi.conf&#8221;</p>
</blockquote>
<p style="margin-bottom: 0in;">helloworld, is the name of the django project that i am deploying in django. After doing all the steps don&#8217;t forget to restart the apache service for the changes to take effect.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxmonk.org/2009/06/27/deploying-django-in-apache-using-mod_wsgi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
