title: Problems running `foreman start` / deploying Django app to Heroku
body: <p>This is what my directory structure looks like (I've included only the relevant parts):</p>
  
  <pre><code>my_git_root/
  ├── Procfile
  ├── README.md
  ├── requirements.txt
  └── my_django_project
      ├── app1
      │   ├── admin.py
      │   ├── __init__.py
      │   ├── models.py
      │   ├── tests.py
      │   ├── urls.py
      │   └── views.py
      ├── fabfile.py
      ├── app2
      │   ├── __init__.py
      │   ├── models.py
      │   ├── templates
      │   ├── tests.py
      │   └── views.py
      ├── manage.py
      └── my_django_project
          ├── __init__.py
          ├── settings
          │   ├── base.py
          │   ├── __init__.py
          │   ├── local.py
          │   ├── production.py
          │   └── staging.py
          ├── static
          ├── urls.py
          └── wsgi.py
  </code></pre>
  
  <p>Following the <a href="https://devcenter.heroku.com/articles/getting-started-with-django" rel="nofollow noreferrer">official Heroku docs</a>, here's what I have in my <code>Procfile</code>:</p>
  
  <pre><code>web: gunicorn my_django_project.wsgi
  </code></pre>
  
  <p>But when I run the <code>foreman start</code>, command, I get a long traceback that ends with <code>ImportError: No module named my_django_project.wsgi.</code>. </p>
  
  <p>Moving <code>Procfile</code> from <code>git_root/</code> to <code>my_django_project/</code> (the Django project root) seems to work (like what was done in <a href="https://stackoverflow.com/questions/18076444/specifying-project-root-when-deploying-to-heroku">this post</a>), but only locally -- attempting to deploy to Heroku seems to be ok, until you try to scale the web processes: </p>
  
  <pre><code>$ heroku ps:scale web=1
  Scaling web dynos... failed 
   !    No such process type web defined in Procfile. 
  </code></pre>
  
  <p>It would appear as though <a href="https://devcenter.heroku.com/articles/procfile#declaring-process-types" rel="nofollow noreferrer">Heroku wants you to put the Procfile in the project's git repository root</a>, but I've tried lots of combinations in <code>Procfile</code> and none seem to work. I've also tried:</p>
  
  <pre><code>web: gunicorn my_django_project/my_django_project.wsgi
  </code></pre>
  
  <p>in the <code>Procfile</code> but that results in <code>ImportError: Import by filename is not supported.</code></p>
  
  <p>Specifying the python path doesn't work either; i.e.</p>
  
  <pre><code>web: gunicorn my_django_project.wsgi:application --pythonpath=/app/my_django_project
  </code></pre>
  
  <p>throws the error <code>ImportError: No module named my_django_project.wsgi</code>. </p>
  
  <p>However, running locally with gunicorn from <code>git_root/my_django_project/</code> seems to work:</p>
  
  <pre><code>$ gunicorn -b 0.0.0.0:8000 my_django_project.wsgi:application            
  2013-10-15 16:55:31 [5703] [INFO] Starting gunicorn 18.0
  2013-10-15 16:55:31 [5703] [INFO] Listening at: http://0.0.0.0:8000 (5703)
  2013-10-15 16:55:31 [5703] [INFO] Using worker: sync
  2013-10-15 16:55:31 [5708] [INFO] Booting worker with pid: 5708
  2013-10-15 16:56:04 [5703] [INFO] Handling signal: winch
  2013-10-15 16:56:04 [5703] [INFO] SIGWINCH ignored. Not daemonized
  </code></pre>
  
  <p>So my guess is that the syntax in my <code>Procfile</code> is incorrect, but I'm not sure how. </p>