Wednesday, March 30, 2016

Deploy static assets to heroku from local machine - can't open file '': [Errno 2] No such file or directory

I am trying deploy my assets files to heroku and I get this output in my command line interface:

(nrb_dev)   neurorehabilitation_projects git:(master)  heroku run python collectstatic  Running python collectstatic on neurorehabilitation.... up, run.5168  python: can't open file '': [Errno 2] No such file or directory  (nrb_dev) ➜  neurorehabilitation_projects git:(master) ✗ 

It's strange for me, due to I am currently in the directory/folder in which the file is located

I've applied chmod +x and try again and this is the output again:

nrb_dev) neurorehabilitation_projects git:(master) chmod +x (nrb_dev) neurorehabilitation_projects git:(master) heroku run ./ collectstatic Running ./ collectstatic on neurorehabilitation.... up, run.8892 bash: ./ No such file or directory (nrb_dev) neurorehabilitation_projects git:(master)

When i execute the git push heroky master command without deplu my asset static files before  I get this

remote:      $ python collectstatic --noinput  remote:        Traceback (most recent call last):  remote:          File "", line 10, in <module>  remote:            execute_from_command_line(sys.argv)  remote:          File "/app/.heroku/python/lib/python3.4/site-packages/django/core/management/", line 353, in execute_from_command_line  remote:            utility.execute()  remote:          File "/app/.heroku/python/lib/python3.4/site-packages/django/core/management/", line 345, in execute  remote:            self.fetch_command(subcommand).run_from_argv(self.argv)  remote:          File "/app/.heroku/python/lib/python3.4/site-packages/django/core/management/", line 348, in run_from_argv  remote:            self.execute(*args, **cmd_options)  remote:          File "/app/.heroku/python/lib/python3.4/site-packages/django/core/management/", line 399, in execute  remote:            output = self.handle(*args, **options)  remote:          File "/app/.heroku/python/lib/python3.4/site-packages/django/contrib/staticfiles/management/commands/", line 176, in handle  remote:            collected = self.collect()  remote:          File "/app/.heroku/python/lib/python3.4/site-packages/django/contrib/staticfiles/management/commands/", line 98, in collect  remote:            for path, storage in finder.list(self.ignore_patterns):  remote:          File "/app/.heroku/python/lib/python3.4/site-packages/django/contrib/staticfiles/", line 112, in list  remote:            for path in utils.get_files(storage, ignore_patterns):  remote:          File "/app/.heroku/python/lib/python3.4/site-packages/django/contrib/staticfiles/", line 28, in get_files  remote:            directories, files = storage.listdir(location)  remote:          File "/app/.heroku/python/lib/python3.4/site-packages/django/core/files/", line 299, in listdir  remote:            for entry in os.listdir(path):  remote:        FileNotFoundError: [Errno 2] No such file or directory: '/app/neurorehabilitation/settings/static'

I cannot understand the reason by which my heroku toolbet cannot locate my file

Somebody what is the reason about it?

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment