Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django 1.8 python: can't open file 'manage.py': [Errno 2] No such file or directory

Tags:

python

django

I am inside my project's outer directory. When I try python manage.py runserver,it works but if I try to deploy my code and execute heroku run python manage.py migrate, it shows the following error -

(cenv) C:\Users\Machine\cenv\myproject>heroku run python manage.py migrate
 Running `python manage.py migrate` attached to terminal... up, run.6848
 python: can't open file 'manage.py': [Errno 2] No such file or directory

but when I input DIR it shows that manage.py is in the same directory.

   <DIR>          .
   <DIR>          ..
           59 .gitignore
   <DIR>          2015
   <DIR>          feature
          254 manage.py
   <DIR>          media
   <DIR>          myproject
           43 Procfile
          355 requirements.txt
           12 runtime.txt
          723 bytes
          12,963,143,680 bytes free


    (cenv) C:\Users\Machine\cenv\myproject>heroku run ls -al
    Running `ls` attached to terminal... failed
    !    App not found

    (cenv) C:\Users\Machine\cenv\myproject>heroku run pwd
    Running `pwd` attached to terminal... up, run.3539
    /app
like image 494
WutWut Avatar asked Oct 19 '25 05:10

WutWut


1 Answers

You must not be in the right directory on the Heroku server. Try running heroku run ls -al to see what is in the current working directory.

Try heroku run pwd to see where you are.

You can also run heroku run bash to get a bash shell to poke around with.

Post what your first couple of commands return.

like image 108
mikeb Avatar answered Oct 21 '25 19:10

mikeb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!