title: Django Deploying on Alwaysdata
body: <p>I readed the <a href="http://wiki.alwaysdata.com/wiki/Deploying_a_Django_App" rel="nofollow">deploying django app</a> from Alwaysdata and I have a problem. </p>
  
  <p>We I run <code>bash django.fcgi</code>, terminal shows :</p>
  
  <pre><code>import: unable to open X server `' @ import.c/ImportImageCommand/367.
  django.fcgi: line 5: syntax error near unexpected token `('
  django.fcgi: line 5: `PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))'
  </code></pre>
  
  <p>I made all they said but I can't fix that. I run on Django 1.5.</p>
  
  <pre><code>- mymodule
  - mysite
  ... __init__.py
  ... settings.py
  ... urls.py
  .. wsgi.py
  - public
  ... django.fcgi
  ... .htaccess
  ... static
  ... media
  - manage.py
  - statics
  - templates
  - __init__.py
  </code></pre>
  
  <p>This is <code>django.fcgi</code> and <code>.htaccess</code> :</p>
  
  <pre><code>#!/usr/bin/python
  
  import os, sys
  
  PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  sys.path.insert(0, PROJECT_DIR)
  sys.path.insert(0, os.path.dirname(PROJECT_DIR))
  
  PROJECT_NAME = PROJECT_DIR.split('/')[-1]
  os.environ['DJANGO_SETTINGS_MODULE'] = "settings"
  
  from django.core.servers.fastcgi import runfastcgi
  runfastcgi(method="threaded", daemonize="false")
  </code></pre>
  
  <hr>
  
  <pre><code>AddHandler fcgid-script .fcgi
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ django.fcgi/$1 [QSA,L]
  </code></pre>
  
  <p>Where is my problem ? I encoded my django.fcgi file in Unicode BOM, like <a href="http://forum.alwaysdata.com/viewtopic.php?id=2751" rel="nofollow">here</a> but no results. Have you any idea ?
  Thank you... </p>
  
  <p>EDIT: And well, my website doesn't work : 500 Internal Server Error.</p>
  
  <p>Server configuration : Apache, Python 2.6, Django 1.5</p>