5

I'm learning how to deploy a Django project with Heroku.

And I notice two files in this repository (git from tutorial): https://github.com/heroku/python-getting-started

The file Procfile, I do understand what's for. However, the file Procfile.windows is something that I quite not understand.

Any help will be appreciated.

Alvaro Silvino
  • 9,441
  • 12
  • 52
  • 80

2 Answers2

8

I'm just starting and running into the same issue. I believe that some django packages e.g. gunicorn don't work on Windows.

That's why the Heroku example app comes pre-packed with a separate "Procfile.windows" that does not use gunicorn.

To use it, do

heroku local -f Procfile.windows

... now just to find out how to make it the default.

Community
  • 1
  • 1
ripper234
  • 222,824
  • 274
  • 634
  • 905
  • Indeed. God, django is such a pain to configure. I'm thinking of dropping it in favor of some simpler micro-server. – ripper234 Apr 06 '16 at 04:53
  • Believe me , I use web sphere in my job and it's a pain greater. I miss old days with php and Apache servers. No frameworks hehhehe thanks for the answer. – Alvaro Silvino Apr 06 '16 at 12:21
3

Procfile.windows is the file for Windows machine to run the application locally. Follow the steps below and try it out yourself:

  1. Create a file called Procfile.windows at the same level where manage.py resides.
  2. Add this inside the file: web: python manage.py runserver
  3. Run this in your cmd: heroku local web -f Procfile.windows or heroku local -f Procfile.windows

Also, you can follow the steps from the official Heroku website (https://devcenter.heroku.com/articles/deploying-python#build-your-app-and-run-it-locally). This is probably the better way to do it in my opinion.

ian0411
  • 4,115
  • 3
  • 25
  • 33