Icons can not be shown
Hello everyone, I uploaded my website to railway but I can not see any icons or images. Could you help me for this? Thanks
10 Replies
Project ID:
N/A
gonna need a lot more information, for starters what kind of site is this
ıt looks like a to-do app, but I added some icons to visualize. But can't see any images
sorry that's not what I meant, what framework is this app built on
django
here is railways django template
https://github.com/railwayapp-templates/django
it uses whitenoise for static assets
you'll likely need to use a similar start command, and setup whitenoise according to their documentation
https://whitenoise.readthedocs.io/en/latest/django.html
thank you I will try
but as I understand I need to import whitenoise before I upload to github
I am not sure it will be uploaded if i write import on github
but thanks
now I am going, I will inform you tomorrow
IIRC a typical Django installation would have separate directories for serving static files when in development and in production. In production you'd want to run the
python manage.py collectstatic
command to move the static files from the dev directories and into the production one. So likely that's what you're missing right now. This command is also executed as part of the start command in the template that Brody posted.I run python manage.py collectstatic command and I can see the images both in static and staticfiles
I can see images in github
How are you linking to the images in your app?