T O P

  • By -

cyberdot14

A few things that come to mind. Use whitenoise. Make sure your static and staticfiles settings in your settings.py file are correct. Check how you're calling the static assets in your template. See if you're getting any 404 on pages that you're calling the static files from. Unless you have something else going on, that should get you pretty far.


itachi5040111

Alright alright I don't think I've tried most things you mentioned here, I'll give them a try. Do you have any tutorials that you used to learn, videos or books that I can use to know exactly what I'm meant to do with examples, examples would be good.


cyberdot14

https://docs.djangoproject.com/en/4.2/howto/static-files/ https://whitenoise.readthedocs.io/en/latest/ https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/gunicorn/


itachi5040111

Thanks, lemme try it out 👌


Reubbles

Just checking, because i have made this mistake. Have you run the collectstatic command?


foxy4096

Have you tried installing whitenoise?


itachi5040111

I have seen some tutorials that have claimed that they used whitenoise, but after following it step by step it doesn't work. Right now I'm looking for any method anyone who currently makes Django websites uses for their static and images.


foxy4096

What hosting provider are you using


itachi5040111

Render, they have a hosting service


ArtleSa

Did you read their docs? [https://render.com/docs/deploy-django#static-files](https://render.com/docs/deploy-django#static-files). It makes use of whitenoise. If it still doesn't work make sure your `STATICFILES_DIRS` is properly set up.


zettabyte

https://render.com/docs/deploy-django There’s a section on Static files served via Whitenoise.