I am deploying my Django application on Heroku. It has been deployed successfully. But static files are not loading.
I followed this link, but when Whitenoise 3.x is included, the command
python manage.py collectstatic --noinput
fails.
my Procfile:
python manage.py collectstatic --noinput
web:python manage.py runserver
web: gunicorn MovieTracker.wsgi --log-file -
heroku ps:scale web=1
I have also tried with :
heroku config:set DISABLE_COLLECTSTATIC=1
and also :
heroku config:set DISABLE_COLLECTSTATIC=0
The settings.py file is:
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'tracker',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
# 'whitenoise.middleware.WhiteNoiseMiddleware',
)
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, "/tracker/static")
# STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
with whitenoise enabled, ERROR: