[Django]-Heroku django "OSError: [Errno 2] No such file or directory: '/static/static'"

2👍

If you have declared your ‘STATICFILES_DIRS’ variable as below,

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static'),
]

ensure:

  1. a static folder (the folder must be named as you specified in the ‘STATICFILES_DIRS’ variable) exists.
  2. it contains a file. You can name a dummy file as ‘.any’ if you’ve got no file yet.

1👍

Currently, it seems that the error comes from the STATICFILES_DIRS var points to a directory that does not exist:

STATICFILES_DIRS = (os.path.join(os.path.dirname(BASE_DIR), "static", "static" )

Go to your Django project directory, find the static repository, and note the absolute location.
Then, edit the STATICFILES_DIRS variable in settings.py sothat it points to this location.

For me (that does not imply it should be the same for you), it looks like this:

STATICFILES_DIRS = (os.path.join(BASE_DIR, '../myapp/static'),)

Leave a comment