I am getting 500 server error because there seems to be an issue with my static files:
my project folder name is register and I have different setting files for production and development:
register
--live-static
--register
----settings
------__init__.py
-----common.py
-----production.py
-----development.py
--live-static
--static
In my production.py file I have:
from register.settings.common import *
import django_heroku
django_heroku.settings(locals())
DEBUG = False
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')
]
STATIC_ROOT = os.path.join(BASE_DIR, 'live-static', 'static-root')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'live-static', 'media-root'
I have already ran:
python manage.py collect static
heroku run python manage.py collectstatic
and I got the following result:
1626 static files copied to '/app/live-static/static-root', 4464 post-processed.
However, after I visit my website I get an error:
raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name)
2020-09-07T19:46:28.324481+00:00 app[web.1]: ValueError: Missing staticfiles manifest entry for 'css/main.css'
in my template I have {% static 'css/main.css' %}
I do not know why i am still getting an error as my collect static has already worked properly. I'd appreciate any help.