Heroku does not load statics files in Django framework
Hello everyone, I am starting in the development of web applications with python 3.6 using the Django framework and I use the free Heroku service for tests, the issue is that after pushing the git application Heroku shows me the flat html without loading the static CSS, JS, and images thing that does django locally. What I do notice is that the django admin does load its static.
setting.py
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATES_DIR = os.path.join(BASE_DIR,"templates")
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'staticfiles'),
]
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
wsgi.py
application = get_wsgi_application()
application = WhiteNoise(application, root='/staticfiles/')
application.add_files('/staticfiles/homepage/',prefix='homepage-statics')
The static ones that I want to load are in the root dir inside the homepage.