I clone my project on server ubuntu 22.04 from digitalocean and then I followed all the steps to configure django with postgresql, gunicorn and nginx. Finally when I open mi domain on chrome, it doesn’t show all the static files.
This is one common source of problems. Having your static files in your home directory is not a good practice. You want your static files to be located in an areas generally and typically available to nginx - something like /var/www/static or /var/www/project/static depending upon whether you’re running multiple applications in this instance.
Other things to check are to verify that collectstatic has copied the files in the right directory structure to the right target and verifying that your references to those static files are coded properly using the static tag in your templates. (This is particularly useful in those cases where some files work and some don’t.)
Hello I am having the same issue here, I have tried everything I have found online. The only thing loading is the HTML. I was running it on my dev PC with whitenoise, DEBUG disabled, everything works properly. Then I uploaded it to a Ubuntu server on the cloud and configured it with gunicorn and nginx. The website runs, just not loading the images, css and js files (static files). I don’t know what else to do.
in the ubuntu VPS
Static files are living at /var/www/site/static/website
Ran the collectstatic and moved all static files to the above location
Welcome! We’ll be more than happy to help you try to resolve this. However, this particular topic is over a year old and has been marked as solved. I suggest you open a new topic for this issue - it’s likely to attract more attention that way.
Also, when you do, please enclose the text of your code and configuration files between lines of three backtick - ` characters. This means you’ll have a line of ```, then the code (or conf file), then another line of ```.