Open muxuezi opened 6 years ago
i was getting the same issue plz give me solution
I read the component made by heroku and discover something that fix my problem https://github.com/heroku/django-heroku/blob/master/django_heroku/core.py
They create the directory /staticfiles/ if it doesnt exist, so I created ALSO /static/ and that solves my problem.
This is my settings.py BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file))) ... MIDDLEWARE = [... 'whitenoise.middleware.WhiteNoiseMiddleware', ... ] ... SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') STATIC_TMP = os.path.join(BASE_DIR, 'static') STATIC_URL = '/static/'
os.makedirs(STATIC_TMP, exist_ok=True) os.makedirs(STATIC_ROOT, exist_ok=True)
STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'), )
///
Actually look at the error:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/build_f52ae90b128b348cb2a6880ecac30818/static'
There's no static folder