2

I'm trying to work with Django on Heroku and I'm following this tutorial with its Django template https://devcenter.heroku.com/articles/django-app-configuration https://devcenter.heroku.com/articles/deploying-python

But when i run 'heroku local web' it always look in the wrong directory. I've tried to move the project

(env) D:\Study\Workbench\heroku-testing\testing\env\codeShareApp>heroku local web
[WARN] No ENV file found
[WARN] ENOENT: no such file or directory, open 'C:\Users\William\Procfile' 
[FAIL] No Procfile and no package.json file found in Current Directory - See 
run_foreman.js --help

The project directory is as follows

env/
    codeShareApp/
        .idea/
        codeShareApp/
        .env
        manage.py
        Procfile
        requirements.txt
        runtime
    include/
    Lib/
    Scripts/
    tcl/

EDIT: I tried to make a new project with directory like below, but still got the same error

codeShareApp/
    codeShareApp/
    env/
    .env
    manage.py
    Procfile
    requirements.txt
    runtime
Waristea
  • 55
  • 1
  • 9
  • Show us your `static_ROOT/URL` in the settings.py file. You probably have to change it to just `static`. Heroku is looking for a path which only exists on your local computer. – hansTheFranz Aug 02 '17 at 09:06
  • Show the contents of `.env`. There's probably something in there that's telling it to look in the wrong place. – Daniel Roseman Aug 02 '17 at 09:18
  • @hansTheFranz My project looks exactly what is shown in the template and its set like that by default – Waristea Aug 02 '17 at 09:49
  • @DanielRoseman My .env only has this line in it: WEB_CONCURRENCY=2 – Waristea Aug 02 '17 at 09:53

3 Answers3

2

I encounter this problem also in a project; I solved this by Making sure that the Procfile is using the correct syntax, and that there are no extra tabs or newlines in the file. especially whitespcae.

ife brand
  • 51
  • 6
1

I dont know why, but I tried it on another machine and it works just fine. It seems that it has something to do with heroku cli 6.13 because the error only occurs after it updates from version 5.12 to 6.12

Waristea
  • 55
  • 1
  • 9
0

The documentation says:

The file must be placed in the root directory of your application. It will not function if placed in a subdirectory.

Try to do this and it should work. See the docs for more information.

Thiago Rossener
  • 934
  • 1
  • 6
  • 17