<?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>Web Design Stockholm, Graphic Design Stockholm - ApPeL &#187; Development</title>
	<atom:link href="http://appelfreelance.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://appelfreelance.com</link>
	<description>Developer / Designer / Photographer</description>
	<lastBuildDate>Mon, 02 Apr 2012 08:03:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Django Nginx Centos 5</title>
		<link>http://appelfreelance.com/2011/09/django-nginx-centos-5/</link>
		<comments>http://appelfreelance.com/2011/09/django-nginx-centos-5/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 08:49:19 +0000</pubDate>
		<dc:creator>Arno Smit</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Server Configs]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[FLUP]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://appelfreelance.com/?p=279</guid>
		<description><![CDATA[From our earlier installation we went ahead and set up a CentOS box running Django, Apache and mod_wsgi. - you can view that here

Doing a bit of digging around, I have found some substantial information showcasing that Nginx is a much better choice for Django than Apache.

In order to make Nginx work, we need ...]]></description>
			<content:encoded><![CDATA[<p>From our earlier installation we went ahead and set up a CentOS box running Django, Apache and mod_wsgi. &#8211; <a title="A working copy, Django, PIL, Imaging, libjpeg, mysql, git, apache, mod_wsgi, easy_install, pip, django-imagekit, cdn storage on CentOS 5.4" href="http://bit.ly/pQirM5">you can view that here</a></p>
<p>Doing a bit of digging around, I have found some substantial information showcasing that Nginx is a much better choice for Django than Apache.</p>
<p>In order to make Nginx work, we need some sort of wsgi combined with Nginx, the easiest way to get this done is to install FLUP</p>
<p><code>/opt/python2.6/bin/pip install flup</code></p>
<p><strong>Now let’s go ahead and create another user that will run a separate process, and also allow us to debug easier if something goes wrong.</strong></p>
<p><strong>Add Nginx user</strong></p>
<p><code>useradd nginx<br />
passwd -d nginx</code></p>
<p><strong>Install Nginx</strong></p>
<p><code>yum install nginx<br />
cd /etc/nginx/<br />
mv nginx.conf nginx-backup.conf<br />
touch nginx.conf<br />
vi nginx.conf</code></p>
<p><strong>NGINX config file example (make sure to replace /www/django_test1/mysite with your project root)</strong></p>
<p><code>user  nginx nginx;<br />
worker_processes  2;<br />
error_log /var/log/nginx/error_log info;<br />
events {<br />
&nbsp;&nbsp;&nbsp;&nbsp;worker_connections  1024;<br />
&nbsp;&nbsp;&nbsp;&nbsp;use epoll;<br />
}</p>
<p>http {<br />
&nbsp;&nbsp;&nbsp;&nbsp;include /etc/nginx/mime.types;<br />
&nbsp;&nbsp;&nbsp;&nbsp;default_type application/octet-stream;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;log_format main<br />
&nbsp;&nbsp;&nbsp;&nbsp;'$remote_addr - $remote_user [$time_local] '<br />
&nbsp;&nbsp;&nbsp;&nbsp;'"$request" $status $bytes_sent '<br />
&nbsp;&nbsp;&nbsp;&nbsp;'"$http_referer" "$http_user_agent" '<br />
&nbsp;&nbsp;&nbsp;&nbsp;'"$gzip_ratio"';</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;client_header_timeout 10m;<br />
&nbsp;&nbsp;&nbsp;&nbsp;client_body_timeout 10m;<br />
&nbsp;&nbsp;&nbsp;&nbsp;send_timeout 10m;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;connection_pool_size 256;<br />
&nbsp;&nbsp;&nbsp;&nbsp;client_header_buffer_size 1k;<br />
&nbsp;&nbsp;&nbsp;&nbsp;large_client_header_buffers 4 2k;<br />
&nbsp;&nbsp;&nbsp;&nbsp;request_pool_size 4k;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;gzip on;<br />
&nbsp;&nbsp;&nbsp;&nbsp;gzip_min_length 1100;<br />
&nbsp;&nbsp;&nbsp;&nbsp;gzip_buffers 4 8k;<br />
&nbsp;&nbsp;&nbsp;&nbsp;gzip_types text/plain;<br />
&nbsp;&nbsp;&nbsp;&nbsp;output_buffers 1 32k;<br />
&nbsp;&nbsp;&nbsp;&nbsp;postpone_output 1460;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;sendfile on;<br />
&nbsp;&nbsp;&nbsp;&nbsp;tcp_nopush on;<br />
&nbsp;&nbsp;&nbsp;&nbsp;tcp_nodelay on;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;keepalive_timeout 75 20;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;ignore_invalid_headers on;<br />
&nbsp;&nbsp;&nbsp;&nbsp;index index.html;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;server {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;listen 80;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;server_name localhost;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location /media/  {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root /www/django_test1/mysite; # Replace with your own project root<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;location /mediaadmin/  {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alias /opt/python2.6/lib/python2.6/site-packages/django/contrib/admin; # Alias to where our admin media root lives<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;location / {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# host and port to fastcgi server<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_pass 127.0.0.1:8080;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_param PATH_INFO $fastcgi_script_name;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_param REQUEST_METHOD $request_method;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_param QUERY_STRING $query_string;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_param CONTENT_TYPE $content_type;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_param CONTENT_LENGTH $content_length;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_pass_header Authorization;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastcgi_intercept_errors off;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;access_log /var/log/nginx/localhost.access_log main;<br />
&nbsp;&nbsp;&nbsp;&nbsp;error_log /var/log/nginx/localhost.error_log;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}</code></p>
<p>If you are running a prior version of apache make sure to stop it.<br />
<code>/etc/init.d/httpd stop</code></p>
<p><strong>Start my FastCGI</strong></p>
<p><code>cd /www/django_test1/mysite/<br />
python manage.py runfcgi host=127.0.0.1 port=8080 --settings=settings<br />
/etc/init.d/nginx start</code></p>
<p>Now that we have moved away from Apache we need to make sure that apache doesn’t switch back on when we restart the server for any needs.</p>
<p><code>chkconfig httpd off<br />
chkconfig --add nginx<br />
chkconfig --level 2345 nginx on<br />
chkconfig --list nginx</code></p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fappelfreelance.com%2F2011%2F09%2Fdjango-nginx-centos-5%2F&amp;layout=button_count&amp;show_faces=false&amp;width=55&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=55px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:60px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://appelfreelance.com/2011/09/django-nginx-centos-5/"count="false"></g:plusone>
			</div>
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://appelfreelance.com/2011/09/django-nginx-centos-5/"  data-text="Django Nginx Centos 5" data-count="horizontal" data-via="appel268576">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p class="wp-flattr-button"></p> <p><a href="http://appelfreelance.com/?flattrss_redirect&amp;id=279&amp;md5=1c3d4b6fa6bce3e9785e286f816c2905" title="Flattr" target="_blank"><img src="http://appelfreelance.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://appelfreelance.com/2011/09/django-nginx-centos-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python 2.7, OS X Lion and PIL, _imaging and Image</title>
		<link>http://appelfreelance.com/2011/07/python-2-7-os-x-lion-and-pil-_imaging-and-image/</link>
		<comments>http://appelfreelance.com/2011/07/python-2-7-os-x-lion-and-pil-_imaging-and-image/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 10:07:36 +0000</pubDate>
		<dc:creator>Arno Smit</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Server Configs]]></category>
		<category><![CDATA[Imaging]]></category>
		<category><![CDATA[libjpeg]]></category>
		<category><![CDATA[PIL]]></category>
		<category><![CDATA[Python 2.7]]></category>
		<category><![CDATA[Python Imaging Library]]></category>

		<guid isPermaLink="false">http://appelfreelance.com/?p=264</guid>
		<description><![CDATA[My default version of Python was still on 2.6 so I had to switch to 2.7

defaults write com.apple.versioner.python Version 2.7

get v8c of jpeg
cd into jpeg directory.

sudo make clean
CC="gcc -arch i386" ./configure --enable-shared --enable-static
make 
sudo make install

get imaging i am using 1.1.6

untar
cd into imaging
sudo rm -rf build
vi setup.py
JPEG_ROOT = libinclude(“/usr/local/lib”)
sudo python setup.py install

And it's that ...]]></description>
			<content:encoded><![CDATA[<p>My default version of Python was still on 2.6 so I had to switch to 2.7</p>
<p><code>defaults write com.apple.versioner.python Version 2.7</code></p>
<p>get <a href="http://www.ijg.org/files/jpegsrc.v8c.tar.gz">v8c of jpeg</a><br />
cd into jpeg directory.</p>
<p><code>sudo make clean<br />
CC="gcc -arch i386" ./configure --enable-shared --enable-static<br />
make<br />
sudo make install</code></p>
<p>get imaging i am using 1.1.6</p>
<p>untar<br />
cd into imaging<br />
<code>sudo rm -rf build<br />
vi setup.py<br />
JPEG_ROOT = libinclude(“/usr/local/lib”)<br />
sudo python setup.py install</code></p>
<p>And it&#8217;s that simple</p>
<p>Run your python interpreter, </p>
<p><code>import PIL<br />
import _imaging<br />
import Image</code></p>
<p>if all is well, then your all set.</p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fappelfreelance.com%2F2011%2F07%2Fpython-2-7-os-x-lion-and-pil-_imaging-and-image%2F&amp;layout=button_count&amp;show_faces=false&amp;width=55&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=55px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:60px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://appelfreelance.com/2011/07/python-2-7-os-x-lion-and-pil-_imaging-and-image/"count="false"></g:plusone>
			</div>
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://appelfreelance.com/2011/07/python-2-7-os-x-lion-and-pil-_imaging-and-image/"  data-text="Python 2.7, OS X Lion and PIL, _imaging and Image" data-count="horizontal" data-via="appel268576">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://appelfreelance.com/2011/07/python-2-7-os-x-lion-and-pil-_imaging-and-image/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>SAK konstföreningen</title>
		<link>http://appelfreelance.com/2011/05/sak-konstforeningen/</link>
		<comments>http://appelfreelance.com/2011/05/sak-konstforeningen/#comments</comments>
		<pubDate>Tue, 17 May 2011 08:11:45 +0000</pubDate>
		<dc:creator>Arno Smit</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[excel to wordpress]]></category>
		<category><![CDATA[SAK]]></category>
		<category><![CDATA[SAK - Sveriges Allmänna Konstförening]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://appelfreelance.com/?p=258</guid>
		<description><![CDATA[Over the past few months we have been working very closely with SAK in order to move their old site over to a new one that makes a lot more sense.

We started this project with some inside knowledge on how the site was built but it ended up being bigger than Ben Hur.

The old ...]]></description>
			<content:encoded><![CDATA[<p>Over the past few months we have been working very closely with SAK in order to move their old site over to a new one that makes a lot more sense.</p>
<p>We started this project with some inside knowledge on how the site was built but it ended up being bigger than Ben Hur.</p>
<p>The old site consisted of real old technology and all their records were kept in excel spreadsheets&#8230; not very good</p>
<p>So first of all we have to map out the relationships between the different sections of the site, and then we had to build a very intricate php extractor that took all of the data and mapped it over to a wordpress compatible db.</p>
<p>Many hours later we extracted all their data, built and re-imported all their images.</p>
<p>Here is the final results <a title="SAK - Sveriges Allmänna Konstförening" href="http://www.konstforeningen.se/" target="_blank">SAK &#8211; Sveriges Allmänna Konstförening</a></p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fappelfreelance.com%2F2011%2F05%2Fsak-konstforeningen%2F&amp;layout=button_count&amp;show_faces=false&amp;width=55&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=55px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:60px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://appelfreelance.com/2011/05/sak-konstforeningen/"count="false"></g:plusone>
			</div>
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://appelfreelance.com/2011/05/sak-konstforeningen/"  data-text="SAK konstföreningen" data-count="horizontal" data-via="appel268576">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://appelfreelance.com/2011/05/sak-konstforeningen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My-hunt.com &#8211; a social network for hunters, outfitters</title>
		<link>http://appelfreelance.com/2011/03/my-hunt-com-a-social-experiment-for-hunters/</link>
		<comments>http://appelfreelance.com/2011/03/my-hunt-com-a-social-experiment-for-hunters/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 08:19:15 +0000</pubDate>
		<dc:creator>Arno Smit</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[Investor]]></category>
		<category><![CDATA[Online Marketing]]></category>
		<category><![CDATA[Server Configs]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Hunting]]></category>
		<category><![CDATA[hunting gear]]></category>
		<category><![CDATA[hunting news]]></category>
		<category><![CDATA[hunting reports]]></category>
		<category><![CDATA[my hunt]]></category>
		<category><![CDATA[my-hunt.com]]></category>
		<category><![CDATA[outdoors]]></category>

		<guid isPermaLink="false">http://appelfreelance.com/?p=255</guid>
		<description><![CDATA[Over the last summer I spent most of my time working on one of my greatest achievements to date - my-hunt.com

My-hunt.com is a social experience/experiment for hunters that allows them to upload their hunting trophies, write hunting reports, learn more about the animals you hunt and also a friendship network.

Through the signup process you ...]]></description>
			<content:encoded><![CDATA[<p>Over the last summer I spent most of my time working on one of my greatest achievements to date &#8211; <a title="My-Hunt.com" href="http://www.my-hunt.com/" target="_blank">my-hunt.com</a></p>
<p>My-hunt.com is a social experience/experiment for hunters that allows them to upload their hunting trophies, write hunting reports, learn more about the animals you hunt and also a friendship network.</p>
<p>Through the signup process you can choose whether to be seen as a hunter or whether you want to publish information about your hunting grounds.</p>
<p>We are very excited to introduce this into the market and look forward to expanding and introducing new segments every step of the way.</p>
<p>My-Hunt.com online, WE ARE HUNTING!</p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fappelfreelance.com%2F2011%2F03%2Fmy-hunt-com-a-social-experiment-for-hunters%2F&amp;layout=button_count&amp;show_faces=false&amp;width=55&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=55px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:60px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://appelfreelance.com/2011/03/my-hunt-com-a-social-experiment-for-hunters/"count="false"></g:plusone>
			</div>
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://appelfreelance.com/2011/03/my-hunt-com-a-social-experiment-for-hunters/"  data-text="My-hunt.com &#8211; a social network for hunters, outfitters" data-count="horizontal" data-via="appel268576">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://appelfreelance.com/2011/03/my-hunt-com-a-social-experiment-for-hunters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KeyError raised when using images with NON-ASCII filenames</title>
		<link>http://appelfreelance.com/2011/03/keyerror-raised-when-using-images-with-non-ascii-filenames/</link>
		<comments>http://appelfreelance.com/2011/03/keyerror-raised-when-using-images-with-non-ascii-filenames/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 07:27:06 +0000</pubDate>
		<dc:creator>Arno Smit</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[KeyError]]></category>
		<category><![CDATA[unidecode]]></category>

		<guid isPermaLink="false">http://appelfreelance.com/?p=250</guid>
		<description><![CDATA[I recently created a django app that allows you to create projects, raise funding via social networks etc.

Because this is mainly based in Sweden we have to allow users to make use of NON-ASCII characters such as å ä ö and many other.

Easy way to get around this is to install UNIDECODE which handles ...]]></description>
			<content:encoded><![CDATA[<p>I recently created a django app that allows you to create projects, raise funding via social networks etc.</p>
<p>Because this is mainly based in Sweden we have to allow users to make use of NON-ASCII characters such as å ä ö and many other.</p>
<p>Easy way to get around this is to install UNIDECODE which handles all of this for you.</p>
<p>Each section/file you are going to make use of this remember to import unidecode</p>
<p><code># Import of transliteration module<br />
from unidecode import unidecode</code></p>
<p><strong>To install</strong><br />
<code>pip install Unidecode</code><br />
<strong> </strong></p>
<p><strong>Then clean your picture in your forms.py</strong><br />
<code><br />
def clean_picture(self):<br />
data = self.cleaned_data['picture']<br />
# For correct uploading non-ASCII image_filenames, we use transliteration module: unidecode()<br />
# can be downloaded here: &lt; git clone http://code.zemanta.com/tsolc/git/unidecode &gt;<br />
# Don't forget to import it: from unidecode import unidecode<br />
trans_name = unidecode(data.name)<br />
data.name = trans_name<br />
return data</code></p>
<p><strong>And in your views.p that handles the actual saving</strong></p>
<p><code><br />
if form.is_valid():<br />
# For correct uploading non-ASCII image_filenames, we use transliteration module: unidecode()<br />
# can be downloaded here: &lt; git clone http://code.zemanta.com/tsolc/git/unidecode &gt;<br />
# Don't forget to import it: from unidecode import unidecode<br />
cleaned_form = form.cleaned_data<br />
trans_name = unidecode(cleaned_form['profile_picture'].name)<br />
cleaned_form['profile_picture'].name = trans_name<br />
</code></p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fappelfreelance.com%2F2011%2F03%2Fkeyerror-raised-when-using-images-with-non-ascii-filenames%2F&amp;layout=button_count&amp;show_faces=false&amp;width=55&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=55px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:60px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://appelfreelance.com/2011/03/keyerror-raised-when-using-images-with-non-ascii-filenames/"count="false"></g:plusone>
			</div>
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://appelfreelance.com/2011/03/keyerror-raised-when-using-images-with-non-ascii-filenames/"  data-text="KeyError raised when using images with NON-ASCII filenames" data-count="horizontal" data-via="appel268576">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://appelfreelance.com/2011/03/keyerror-raised-when-using-images-with-non-ascii-filenames/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mod_pagespeed CentOS 5.4</title>
		<link>http://appelfreelance.com/2010/11/mod_pagespeed-centos-5-4/</link>
		<comments>http://appelfreelance.com/2010/11/mod_pagespeed-centos-5-4/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 10:24:06 +0000</pubDate>
		<dc:creator>Arno Smit</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Server Configs]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[CentOS 5.4]]></category>
		<category><![CDATA[Google Pagespeed]]></category>
		<category><![CDATA[mod_pagespeed]]></category>

		<guid isPermaLink="false">http://appelfreelance.com/?p=246</guid>
		<description><![CDATA[Installing mod_pagespeed on CentOS 5.4

wget https://dl-ssl.google.com/linux/linux_signing_key.pub
rpm --import linux_signing_key.pub

32BIT

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_i386.rpm

64BIT

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_x86_64.rpm

yum localinstall mod-pagespeed-*.rpm

/etc/init.d/httpd restart

vi /etc/httpd/conf.d/pagespeed.conf

ModPagespeed on

Uncomment # ModPagespeedRewriteLevel CoreFilters

restart apache

Uncomment # ModPagespeedEnableFilters collapse_whitespace

Go to the google code page and find a list of items in their.

Play around with it a bit and find your best solution.

The full list of available filters, plus descriptions of how ...]]></description>
			<content:encoded><![CDATA[<p><strong>Installing mod_pagespeed on CentOS 5.4</strong></p>
<p>wget https://dl-ssl.google.com/linux/linux_signing_key.pub<br />
rpm &#8211;import linux_signing_key.pub</p>
<p>32BIT</p>
<p>wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_i386.rpm</p>
<p>64BIT</p>
<p>wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_x86_64.rpm</p>
<p>yum localinstall mod-pagespeed-*.rpm</p>
<p>/etc/init.d/httpd restart</p>
<p>vi /etc/httpd/conf.d/pagespeed.conf</p>
<p>ModPagespeed on</p>
<p>Uncomment # ModPagespeedRewriteLevel CoreFilters</p>
<p>restart apache</p>
<p>Uncomment # ModPagespeedEnableFilters collapse_whitespace</p>
<p>Go to the google code page and find a list of items in their.</p>
<p>Play around with it a bit and find your best solution.</p>
<p>The full list of available filters, plus descriptions of how they work and how to use them, is available on the <a href="http://code.google.com/speed/page-speed/docs/filters.html" target="_blank">project&#8217;s Google Code page</a></p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fappelfreelance.com%2F2010%2F11%2Fmod_pagespeed-centos-5-4%2F&amp;layout=button_count&amp;show_faces=false&amp;width=55&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=55px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:60px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://appelfreelance.com/2010/11/mod_pagespeed-centos-5-4/"count="false"></g:plusone>
			</div>
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://appelfreelance.com/2010/11/mod_pagespeed-centos-5-4/"  data-text="mod_pagespeed CentOS 5.4" data-count="horizontal" data-via="appel268576">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://appelfreelance.com/2010/11/mod_pagespeed-centos-5-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nynasbo Campaign Site</title>
		<link>http://appelfreelance.com/2010/09/nynasbo-campaign-site/</link>
		<comments>http://appelfreelance.com/2010/09/nynasbo-campaign-site/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 10:02:35 +0000</pubDate>
		<dc:creator>Arno Smit</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[$.ajax]]></category>
		<category><![CDATA[Dabber Player]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Nynasbo]]></category>
		<category><![CDATA[Nynashamn]]></category>

		<guid isPermaLink="false">http://appelfreelance.com/?p=242</guid>
		<description><![CDATA[Just recently did a small campaign site for Nynasbo making use of some jQuery ajax, this site was built in PHP and also makes use of The Dabber Player.]]></description>
			<content:encoded><![CDATA[<p>Just recently did a <a href="http://nynasbo.dabber.tv/kampanj/" target="_blank">small campaign site for Nynasbo</a> making use of some jQuery ajax, this site was built in PHP and also makes use of <a href="http://dabber.tv/products/" target="_blank">The Dabber Player.</a></p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fappelfreelance.com%2F2010%2F09%2Fnynasbo-campaign-site%2F&amp;layout=button_count&amp;show_faces=false&amp;width=55&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=55px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:60px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://appelfreelance.com/2010/09/nynasbo-campaign-site/"count="false"></g:plusone>
			</div>
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://appelfreelance.com/2010/09/nynasbo-campaign-site/"  data-text="Nynasbo Campaign Site" data-count="horizontal" data-via="appel268576">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://appelfreelance.com/2010/09/nynasbo-campaign-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Dabber Player</title>
		<link>http://appelfreelance.com/2010/09/the-dabber-player/</link>
		<comments>http://appelfreelance.com/2010/09/the-dabber-player/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 10:00:10 +0000</pubDate>
		<dc:creator>Arno Smit</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[dabber]]></category>
		<category><![CDATA[dabber wordpress]]></category>
		<category><![CDATA[dabber wordpress plugin]]></category>
		<category><![CDATA[wordpress development]]></category>
		<category><![CDATA[wordpress plugin development]]></category>

		<guid isPermaLink="false">http://appelfreelance.com/?p=238</guid>
		<description><![CDATA[Today sees the launch of the long anticipated "Dabber Player".

A flash video player that combines the strength of video encoding and Amazon's S3 services.

The player allows you to create different player with different looks and feels to suite your personality/brand look and feel, video upload and encoding all with a few clicks via your ...]]></description>
			<content:encoded><![CDATA[<p>Today sees the launch of the long anticipated &#8220;Dabber Player&#8221;.</p>
<p>A flash video player that combines the strength of video encoding and Amazon&#8217;s S3 services.</p>
<p>The player allows you to create different player with different looks and feels to suite your personality/brand look and feel, video upload and encoding all with a few clicks via your WordPress admin.</p>
<p>Free and Commercial version available now for download &#8211; <a href="http://bit.ly/9cmTvk" target="_blank">http://bit.ly/9cmTvk</a></p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fappelfreelance.com%2F2010%2F09%2Fthe-dabber-player%2F&amp;layout=button_count&amp;show_faces=false&amp;width=55&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=55px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:60px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://appelfreelance.com/2010/09/the-dabber-player/"count="false"></g:plusone>
			</div>
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://appelfreelance.com/2010/09/the-dabber-player/"  data-text="The Dabber Player" data-count="horizontal" data-via="appel268576">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://appelfreelance.com/2010/09/the-dabber-player/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A working copy, Django, PIL, Imaging, libjpeg, mysql, git, apache, mod_wsgi, easy_install, pip, django-imagekit, cdn storage on CentOS 5.4</title>
		<link>http://appelfreelance.com/2010/07/a-working-copy-django-pil-imaging-libjpeg-mysql-git-apache-mod_wsgi-easy_install-pip-django-imagekit-cdn-storage-on-centos-5-4/</link>
		<comments>http://appelfreelance.com/2010/07/a-working-copy-django-pil-imaging-libjpeg-mysql-git-apache-mod_wsgi-easy_install-pip-django-imagekit-cdn-storage-on-centos-5-4/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 14:29:59 +0000</pubDate>
		<dc:creator>Arno Smit</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[Server Configs]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[CentOS 5.4]]></category>
		<category><![CDATA[CentOS5.4]]></category>
		<category><![CDATA[django south]]></category>
		<category><![CDATA[easy_install]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[libjpeg]]></category>
		<category><![CDATA[mod_wsgi]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PIL]]></category>
		<category><![CDATA[Python Imaging Library]]></category>
		<category><![CDATA[Python2.6]]></category>

		<guid isPermaLink="false">http://appelfreelance.com/?p=211</guid>
		<description><![CDATA[Install Apache, MySQL, SQLite, and other developer packages
yum install httpd-devel mysql mysql-server
yum install mysql-client mysql-devel
yum install apr-devel sqlite3 sqlite-devel
yum install libjpeg libpng gcc make autoconf
yum install libxslt gettext zlib-devel
yum groupinstall “GNOME Desktop Environment”
yum groupinstall “Development Tools”
This tutorial will assume that you are using MySQL on production and you may also use SQLite for development. ...]]></description>
			<content:encoded><![CDATA[<div>
<h3>Install Apache, MySQL, SQLite, and other developer packages</h3>
<p><code>yum install httpd-devel mysql mysql-server<br />
yum install mysql-client mysql-devel<br />
yum install apr-devel sqlite3 sqlite-devel<br />
yum install libjpeg libpng gcc make autoconf<br />
yum install libxslt gettext zlib-devel<br />
yum groupinstall “GNOME Desktop Environment”<br />
yum groupinstall “Development Tools”</code></p>
<p>This tutorial will assume that you are using MySQL on production and you may also use SQLite for development.  If you are using another database like PostgreSQL then you should install those files now.  Also, please note that these are not the only packages that you will need for your webserver, this should just be considered a minimum to get your django app working.</p>
<h3>Add New User</h3>
<p><code>groupadd webmaster<br />
useradd -c “username”  -g webmaster -m -s /bin/bash username<br />
passwd username<br />
passw0rd<br />
visudo</code><br />
Near line 77 where it reads “root ALL=(ALL) ALL add<br />
<code>username ALL=(ALL) ALL</code></p>
<p>From here you can change to your user to leave the root account as is.<br />
If you find that some of the item do not want to run you should use the sudo command</p>
<h3>Install Python 2.6 along side of Python 2.4</h3>
<p>The trick to getting Python 2.6 working on CentOS 5.4 without breaking anything is to install it along side of the default Python 2.4. Do not try to update your default Python 2.4 because important CentOS modules require 2.4.  To do this you will configure python to be installed in /opt/python2.6.  Before you do this step make sure that you have yum installed sqlite-devel because python will look for the sqlite header files in order to build the module for it when you compile python.</p>
<p><code>wget<a href="http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tgz"> http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tgz</a><br />
tar -zxvf Python-2.6.4.tgz<br />
cd Python-2.6.4<br />
./configure --prefix=/opt/python2.6 --with-threads --enable-shared --with-zlib=/usr/include<br />
make<br />
make install<br />
cd ~</code></p>
<h3>After Python is installed in /opt/Python2.6 you need to create symbolic links to it.</h3>
<p><code>ln -s /opt/python2.6/lib/libpython2.6.so /usr/lib<br />
ln -s /opt/python2.6/lib/libpython2.6.so.1.0 /usr/lib<br />
ln -s /opt/python2.6/bin/python /usr/local/bin/python<br />
ln -s /opt/python2.6/bin/python /usr/bin/python2.6<br />
ln -s /opt/python2.6/lib/python2.6.so /opt/python2.6/lib/python2.6/config/</code></p>
<p>Run the ldconfig to update the links to your shared libraries and then check your python version to make sure you can now use 2.6. Also, test to see if there are any conflicts between Python 2.4 and 2.6 using yum.  If you do have problems then double check your symbolic links and make sure that you are not conflicting with /usr/bin/python or /usr/bin/python2.4.</p>
<p><code>/sbin/ldconfig -v<br />
python -V<br />
yum info httpd</code></p>
<h3>Install setuptools, MySQL extension, and Django 1.1</h3>
<p>If you previously installed setuptools but you will need to do again for 2.6 so that the packages are installed in /opt/python2.6. In order to use MySQL with Django you will need to download, build, and install the extension for it.</p>
<p><code>wget<a href="http://bit.ly/6E0DNN%C2%A0"> http://bit.ly/6E0DNN </a><br />
chmod u+x setuptools-0.6c11-py2.6.egg<br />
./setuptools-0.6c11-py2.6.egg --prefix=/opt/python2.6</code></p>
<p><code>wget<a href="http://bit.ly/6j4uID"> http://bit.ly/6j4uID</a><br />
tar -zxvf MySQL-python-1.2.3c1.tar.gz<br />
cd MySQL-python-1.2.3c1<br />
python setup.py build<br />
python setup.py install<br />
cd ..</code></p>
<p><code> </code><code>wget<a href="http://www.djangoproject.com/download/1.1.1/tarball/"> http://www.djangoproject.com/download/1.1.1/tarball/</a><br />
tar -zxvf Django-1.1.1.tar.gz<br />
cd Django-1.1.1<br />
python setup.py build<br />
python setup.py install<br />
cd ..</code></p>
<h3>Setup and Install mod_wsgi</h3>
<p>A majority of the Django community uses<a href="http://wsgi.org/wsgi/Learn_WSGI"> wsgi</a> as the way to interface with the webserver.  I also prefer to use it because it&#8217;s fast and very easy to setup. This tutorial will not go into setting up your app to use wsgi (however, I will give an example at the end),<a href="http://docs.djangoproject.com/en/1.1/howto/deployment/modwsgi/"> but the django project has a good tutorial for this.</a> Please note that this step is very important. You may have previously installed mod_wsgi using yum but you will need to download it and build it using your new 2.6 in order for it to work with your app.</p>
<p><code>wget<a href="http://modwsgi.googlecode.com/files/mod_wsgi-2.8.tar.gz%C2%A0"> http://modwsgi.googlecode.com/files/mod_wsgi-2.8.tar.gz </a><br />
tar -zxvf mod_wsgi-2.8.tar.gz<br />
cd mod_wsgi-2.8<br />
./configure --with-python=/usr/local/bin/python<br />
make<br />
make install<br />
cd ..</code></p>
<h3>Then you will need to edit your Apache httpd.conf in order to load the mod_wsgi module. After this has been completed restart Apache.</h3>
<p><code>vi /etc/httpd/conf/httpd.conf<br />
LoadModule wsgi_module  /usr/lib64/httpd/modules/mod_wsgi.so<br />
line 787<br />
AddHandler wsgi-script .wsgi</code></p>
<p>Make sure your Apache restarts once the module has been loaded</p>
<p><code>/etc/init.d/httpd restart</code></p>
<h3>Create a separate directory for your virtual hosts</h3>
<p>I like to house all my vhosts in a seperate directory</p>
<p><code>cd /etc/httpd/conf<br />
mkdir vhosts<br />
cd vhosts<br />
vi mysite.com.conf</code></p>
<p><code>&lt;VirtualHost 127.0.0.1&gt;<br />
ServerName localhost</code></p>
<p><code>ErrorLog /www/django_test1/mysite/logs/error_log<br />
CustomLog /www/django_test1/mysite/logs/access_log combined</code></p>
<p><code>UseCanonicalName Off</code></p>
<p><code>Alias /media/ "/www/django_test1/mysite/media/"<br />
&lt;Directory "/www/django_test1/mysite/media"&gt;<br />
Order allow,deny<br />
Options Indexes<br />
Allow from all<br />
IndexOptions FancyIndexing<br />
&lt;/Directory&gt;</code></p>
<p><code>Alias /mediaadmin/ "/opt/python2.6/lib/python2.6/site-packages/django/contrib/admin/media/"<br />
&lt;Directory "/opt/python2.6/lib/python2.6/site-packages/django/contrib/admin/media"&gt;<br />
Order allow,deny<br />
Options Indexes<br />
Allow from all<br />
IndexOptions FancyIndexing<br />
&lt;/Directory&gt;</p>
<p></code><code>WSGIScriptAlias / /www/django_test1/mysite.wsgi<br />
WSGIDaemonProcess mysite processes=7 threads=1 display-name=%{GROUP}<br />
WSGIProcessGroup mysite<br />
WSGIApplicationGroup %{GLOBAL}<br />
&lt;/VirtualHost&gt;</code></p>
<h3>Create your mod_wsgi file</h3>
<p>According to a few searches I have done online it is best practive to leave your mod_wsgi file in the parent folder of the app.</p>
<p><code>mkdir /www<br />
cd /www<br />
mkdir django_test1<br />
cd django_test1<br />
vi mysite.wsgi</code></p>
<p><code>#!/opt/python2.6/bin/python</code></p>
<p><code>import os, sys</code></p>
<p><code>sys.path.append('/www/django_test1/mysite')<br />
sys.path.insert(0, '/www/django_test1')<br />
sys.path.insert(0, '/www/django_test1/mysite')</code></p>
<p><code>os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'<br />
os.environ['PYTHON_EGG_CACHE'] = '/www/django_test1/mysite/.python-eggs'</code></p>
<p><code>import django.core.handlers.wsgi</p>
<p></code><code>application = django.core.handlers.wsgi.WSGIHandler()</code></p>
<p>Save the file</p>
<h3>Create a .python-eggs directory</h3>
<p>in mysite</p>
<p><code>mkdir .python-eggs<br />
chmod -R 777 .python-eggs</code></p>
<p><a href="http://mikecantelon.com/story/installing_django_on_centos_5">http://mikecantelon.com/story/installing_django_on_centos_5</a><br />
<a href="http://mikecantelon.com/story/installing_django_on_centos_5"></a><br />
Start the mysql server</p>
<p><code>/etc/rc.d/init.d/mysqld start</code></p>
<h3>Install PIL on CENTOS</h3>
<p><a href="http://athenageek.wordpress.com/2009/06/09/easy_install-pil-not-so-easy/">http://athenageek.wordpress.com/2009/06/09/easy_install-pil-not-so-easy/</a></p>
<p><strong>Install PIP in order to use Imaging</strong></p>
<p><code>/opt/python2.6/bin/easy_install-2.6 pip</code></p>
<p><code> </code><code>/opt/python2.6/bin/pip install http://effbot.org/downloads/Imaging-1.1.6.tar.gz</code></p>
<h3>Install GIT</h3>
<p><a href="http://www.bitsandpix.com/entry/git-installing-git-on-centos-5/">http://www.bitsandpix.com/entry/git-installing-git-on-centos-5/</a><br />
<a href="http://www.bitsandpix.com/entry/git-installing-git-on-centos-5/"></a><br />
<code>rpm -Uvh<a href="http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm"> http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm</a><br />
<a href="http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm"></a><br />
yum install git</code></p>
<h3>Configure MySQL with another user</h3>
<p><code>mysql --user=root mysql<br />
CREATE USER 'webdev'@'localhost' IDENTIFIED BY 'password';<br />
GRANT ALL PRIVILEGES ON *.* TO 'webdev'@'localhost'<br />
IDENTIFIED BY 'password' WITH GRANT OPTION;</code></p>
<h3>Create a Django project</h3>
<p><code>/opt/python2.6/bin/django-admin.py startproject mysite</code></p>
<p>Create a logs directory in your project as this is needed for mod_wsgi and apache</p>
<p><code>cd mysite<br />
mkdir logs</code></p>
<h3>Symlink your admin media folder</h3>
<p><code>mkdir media<br />
chmod -R 777 media<br />
mkdir mediaadmin</code></p>
<p><code> </code><code>ln -s /opt/python2.6/lib/python2.6/site-packages/django/contrib/admin/media /www/django_test1/mysite/mediaadmin/</code></p>
<p>Configure your /etc/httpd/conf/httpd.conf file to include your projects base settings</p>
<p><code>ServerAdmin admin@appelvm01.centos<br />
HostName appelvm01.centos</code></p>
<p><code>ServerName 127.0.0.1</code></p>
<p><code>DocumentRoot "/www/django_test1/mysite"</code></p>
<p><code>&lt;Directory "/www/django_test1/mysite"&gt;<br />
AllowOverride None<br />
Options None<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Directory&gt;</code></p>
<p><code> </code><code># include VirtualHosts config files<br />
Include conf/vhosts/*.conf</code></p>
<p>add WSGISocketPrefix to httpd.conf end of file</p>
<p><code>WSGISocketPrefix /var/run/wsgi</code></p>
<p>Make sure hostname is equal to the one in Apache conf /etc/httpd/conf/httpd.conf<br />
else change by running</p>
<p><code>hostname "new_name"</code></p>
<p>Give permissions</p>
<p><code>chcon -R -h -t httpd_sys_content_t /www/django_test1/mysite</code></p>
<p>I found this wasnt good enough so I had to turn off SElinux</p>
<p><code>vi /etc/selinux/config</code></p>
<p>set</p>
<p><code>SELINUX=disabled</code></p>
<p>According to a blog remove your -Indexes<br />
<a href="http://www.thelinuxblog.com/apache-directory-index-forbidden-by-options-directive/">http://www.thelinuxblog.com/apache-directory-index-forbidden-by-options-directive/</a><br />
<a href="http://www.thelinuxblog.com/apache-directory-index-forbidden-by-options-directive/"></a><br />
<code>vi /etc/httpd/conf.d/welcome.conf<br />
# -Indexes<br />
Indexes</code></p>
<h3>Configure Firewall</h3>
<p><code>sudo vi /etc/sysconfig/iptables-config</code><br />
Make sure following variables are set to &#8220;yes&#8221;:<br />
<code>IPTABLES_SAVE_ON_STOP="yes"<br />
IPTABLES_SAVE_ON_RESTART="yes"</code></p>
<h3>Open Web ports:</h3>
<p><code>sudo /sbin/iptables -I INPUT -p tcp -m state --state NEW,ESTABLISHED --dport 80 -j ACCEPT<br />
sudo /sbin/iptables -I INPUT -p tcp -m state --state NEW,ESTABLISHED --dport 443 -j ACCEPT</code><br />
Restart iptables with:<br />
<code>sudo /sbin/service iptables stop<br />
sudo /sbin/service iptables start</code><br />
Make sure rules are still in. Try restarting server, too, to make sure setting picked up.</p>
<h3>Make sure your MySQL and Apache are always on after restart</h3>
<p><code>/sbin/chkconfig --add httpd<br />
/sbin/chkconfig --level 2345 httpd on<br />
/sbin/chkconfig --list httpd</code></p>
<p><code> </code><code>/sbin/chkconfig --add mysqld<br />
/sbin/chkconfig --level 2345 mysqld on<br />
/sbin/chkconfig --list mysqld</code></p>
<h3>Install South through easy_install to allow for easy db migration</h3>
<p><code>/opt/python2.6/bin/easy_install-2.6 South</code></p>
<h3>Install Django-cumuls for Rackspace/CDN storage</h3>
<p><code>/opt/python2.6/bin/pip install django-cumulus</code></p>
<p><code>/opt/python2.6/bin/pip install -r<a href="http://bitbucket.org/richleland/django-cumulus/raw/0.3.1/requirements.txt"> http://bitbucket.org/richleland/django-cumulus/raw/0.3.3/requirements.txt</a><br />
<a href="http://bitbucket.org/richleland/django-cumulus/raw/0.3.1/requirements.txt"></a><br />
/opt/python2.6/bin/easy_install-2.6 django-imagekit</code></p>
<p>You should now be able to go to your servers ip address, and you should see a welcome screen!</p>
<p>From here on you can start developing your app, you should be able to enable your admins autodiscover and set the urls so that you can access the admin section.</p>
</div>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fappelfreelance.com%2F2010%2F07%2Fa-working-copy-django-pil-imaging-libjpeg-mysql-git-apache-mod_wsgi-easy_install-pip-django-imagekit-cdn-storage-on-centos-5-4%2F&amp;layout=button_count&amp;show_faces=false&amp;width=55&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=55px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:60px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://appelfreelance.com/2010/07/a-working-copy-django-pil-imaging-libjpeg-mysql-git-apache-mod_wsgi-easy_install-pip-django-imagekit-cdn-storage-on-centos-5-4/"count="false"></g:plusone>
			</div>
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://appelfreelance.com/2010/07/a-working-copy-django-pil-imaging-libjpeg-mysql-git-apache-mod_wsgi-easy_install-pip-django-imagekit-cdn-storage-on-centos-5-4/"  data-text="A working copy, Django, PIL, Imaging, libjpeg, mysql, git, apache, mod_wsgi, easy_install, pip, django-imagekit, cdn storage on CentOS 5.4" data-count="horizontal" data-via="appel268576">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://appelfreelance.com/2010/07/a-working-copy-django-pil-imaging-libjpeg-mysql-git-apache-mod_wsgi-easy_install-pip-django-imagekit-cdn-storage-on-centos-5-4/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>libjpeg, PIL, Snow Leopard, Python2.6, _jpeg_resync_to_restart</title>
		<link>http://appelfreelance.com/2010/06/libjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart/</link>
		<comments>http://appelfreelance.com/2010/06/libjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 13:48:32 +0000</pubDate>
		<dc:creator>Arno Smit</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[c _imaging]]></category>
		<category><![CDATA[PIL]]></category>
		<category><![CDATA[Python Imaging Library]]></category>
		<category><![CDATA[Python2.6]]></category>
		<category><![CDATA[_jpeg_resync_to_restart]]></category>

		<guid isPermaLink="false">http://appelfreelance.com/?p=196</guid>
		<description><![CDATA[&#60;h2&#62;Man this has been an error that has been getting me down lately.&#60;/h2&#62;
&#60;p&#62;I have done tons of google searches for c _imaging not installed, PIL, libjpeg, Snow Leopard _jpeg_resync_to_restart and I have finally documented all my steps to rectify this issue.&#60;/p&#62;
&#60;p&#62;If you don’t have this download it first.&#60;/p&#62;
&#60;code&#62;&#60;a href="http://www.ijg.org/files/jpegsrc.v7.tar.gz" target="_blank"&#62;http://www.ijg.org/files/jpegsrc.v7.tar.gz&#60;/a&#62;&#60;/code&#62;
&#60;p&#62;go into your shell environment ...]]></description>
			<content:encoded><![CDATA[<h2>Man this has been an error that has been getting me down lately.</h2>
<p>I have done tons of google searches for c _imaging not installed, PIL, libjpeg, Snow Leopard _jpeg_resync_to_restart and I have finally documented all my steps to rectify this issue.</p>
<p>If you don’t have this download it first.</p>
<p><code><a href="http://www.ijg.org/files/jpegsrc.v7.tar.gz" target="_blank">http://www.ijg.org/files/jpegsrc.v7.tar.gz</a></code></p>
<p>go into your shell environment and untar by running the following</p>
<p><code>tar -zxvf jpegsrc.v7.tar.gz</code></p>
<p><code> </code></p>
<p><code>cd jpeg-7 </code></p>
<p>then run</p>
<p><code>./configure<br />
</code><span style="font-family: monospace;">sudo make clean<br />
</span><span style="font-family: monospace;">sudo CC=&#8221;gcc -arch i386&#8243;./configure &#8211;enable-shared &#8211;enable-static<br />
</span><span style="font-family: monospace;">sudo make<br />
</span><span style="font-family: monospace;">sudo make install</span></p>
<p>Next get PIL and untar it</p>
<p><code><a href="http://effbot.org/downloads/Imaging-1.1.6.tar.gz" target="_blank">http://effbot.org/downloads/Imaging-1.1.6.tar.gz</a><br />
tar -zxvf Imaging-1.1.6.tar.gz<br />
cd Imaging-1.1.6</code></p>
<p>If you already have PIL I would recommend running</p>
<p><code>sudo rm -Rf build</code></p>
<p>to clean any existing builds, this has caused me loads of errors and gray hairs!</p>
<p>in your <em><strong>setup.py</strong></em> file run find <em><strong>JPEG_ROOT</strong></em></p>
<p>amend it so it looks as follows</p>
<p><code>JPEG_ROOT = libinclude(“/usr/local”)</code></p>
<p>Next move onto the build</p>
<p><code>sudo python setup.py build</code></p>
<p>if libjpeg is successfully installed you should be able to run <strong><em>python selftest.py</em></strong> without any errors relating to “jpeg”</p>
<p><code>sudo python setup.py install</code></p>
<p>if all has worked successfully you should be able to enter your python interpreter by executing python in your command line and also do the following:</p>
<p><code>import PIL<br />
import Image<br />
import _imaging</code></p>
<p>without any errors.</p>
<p>Just to triple check I have a simple jpeg on my desktop.</p>
<p><code>image = Image.open(“/Users/MyName/Desktop/myimage.jpeg”)<br />
image.save(“/Users/MyName/Desktop/test.jpeg”)</code></p>
<p>should work without errors <img src='http://appelfreelance.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fappelfreelance.com%2F2010%2F06%2Flibjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart%2F&amp;layout=button_count&amp;show_faces=false&amp;width=55&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=55px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:60px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://appelfreelance.com/2010/06/libjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart/"count="false"></g:plusone>
			</div>
			<div style="float:left; width:55px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://appelfreelance.com/2010/06/libjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart/"  data-text="libjpeg, PIL, Snow Leopard, Python2.6, _jpeg_resync_to_restart" data-count="horizontal" data-via="appel268576">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://appelfreelance.com/2010/06/libjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
	</channel>
</rss>

