title: Deploying Django/Python 3.4 to Heroku
body: <p>I am trying to deploy my first example app with Django/Heroku using the Django/Heroku Getting Started Tutorial. </p>
  
  <p>My tools: Python 3.4 and Windows 7 PowerShell.</p>
  
  <p>My challenge: deploying to Heroku fails and I am not sure why. Upon my first "git push" I saw that python-2.7.0 was used by default. I then added a <code>runtime.txt</code> (python-3.4.0) file in the app root.</p>
  
  <p>Here is what happens when I run <code>git push heroku master</code></p>
  
  <pre><code>-----&gt; Python app detected
  -----&gt; Preparing Python runtime (python-3.4.0)
  -----&gt; Installing Setuptools (2.1)
  -----&gt; Installing Pip (1.5.4)
  -----&gt; Installing dependencies using Pip (1.5.4)
  Exception:
  Traceback (most recent call last):
    File "/app/.heroku/python/lib/python3.4/site-packages/pip-1.5.4-py3.4.egg/pip/basecommand.py", line 122, in main
        status = self.run(options, args)
    File "/app/.heroku/python/lib/python3.4/site-packages/pip-1.5.4-py3.4.egg/pip/commands/install.py", line 262, in run
        for req in parse_requirements(filename, finder=finder, options=options, session=session):
    File "/app/.heroku/python/lib/python3.4/site-packages/pip-1.5.4-py3.4.egg/pip/req.py", line 1546, in parse_requirements
        session=session,
    File "/app/.heroku/python/lib/python3.4/site-packages/pip-1.5.4-py3.4.egg/pip/download.py", line 275, in get_file_content
        content = f.read()
    File "/app/.heroku/python/lib/python3.4/codecs.py", line 313, in decode
  
      (result, consumed) = self._buffer_decode(data, self.errors, final)
     UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
  
         Storing debug log for failure in /app/.pip/pip.log
  
   !     Push rejected, failed to compile Python app
  </code></pre>
  
  <p>Here the content of my <code>requirements.txt</code> file (created with <code>pip freeze &gt; requirements.txt</code>)</p>
  
  <pre><code>Django==1.6.2
  dj-database-url==0.3.0
  dj-static==0.0.5
  django-toolbelt==0.0.1
  gunicorn==18.0
  psycopg2==2.5.2
  pystache==0.5.3
  static==1.0.2
  </code></pre>
  
  <p>Here my <code>Procfile</code> (btw: gunicorn seems to be a Unix "only" command and does not work for Windows; <a href="http://www.swarley.me.uk/blog/2014/02/24/create-a-django-development-environment-on-64-bit-windows-for-heroku-deployment/">read here</a>):</p>
  
  <pre><code>web: gunicorn mytodo.wsgi
  </code></pre>
  
  <p>The Heroku tutorial does not mention a <code>setup.py</code> file, <a href="https://github.com/heroku/heroku-buildpack-python/blob/master/bin/detect">but it seems that one is necessary</a>, so I simply copied a template.... not my preferred solution, but I did not know what else to do.</p>
  
  <pre><code>setup(
      name='mysite',
      version='0.1.0',
      install_requires=[],  # Don't put anything here, just use requirements.txt
      packages=['mysite'],
      package_dir={'mysite': 'src/mysite'},
  )
  </code></pre>
  
  <p>What could be going on:
  - The unicode error message could stem from the <code>Procfile</code>. Somewhere online I read that it has to be ASCII file, but I am not sure how to declare that as the Procfile has no file ending.
  - The setup.py file is wrong.</p>
  
  <p>Any help is appreciated. Thanks!</p>