M
M
marselabdullin2020-05-20 17:56:22
Django
marselabdullin, 2020-05-20 17:56:22

Why is heroku not finding django images?

I have deployed the project to heroku and everything seems to be loading except images, I don't understand what is the problem. There is speculation that this is due to different folder names on the server and local machine, based on this screenshot:

2wZ45.png

Local storage - static/img

Static settings:

STATIC_URL = '/static/'

STATIC_ROOT = 'static/'

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

STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'


Project structure:

AayK7.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Sobolev, 2020-05-20
@Sobolev5

I've never deployed projects to Heroku but have run into a similar error when mimetypes were disabled in the nginx config file.
Perhaps this will help you.

O
Oksana ..., 2020-05-21
@deniz1983

The name of the file is style.css , but it shows you style.csss , and to check the pictures - try directly accessing them from the browser line along the path indicated in html. If it does not find it, then the paths need to be corrected.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question