'Django Static Folder Forbidden (403) on Nginx Digital Ocean

I've successfully followed this tutorial on digital ocean: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04

on deploying a django app - the app works fine but one thing I noticed is that the app can't render styles in the static folder - it returns a 403. Am I missing something? Is it a server issue or do I need to configure something additionally in Django.

Please note if I run python manage.py runserver 0.0.0.0:8000 the styles render fine.



Solution 1:[1]

I ran into a problem where my js modules imported another module and the imported module was not loading with a 403 forbidden message. This was because in my django's settings.py I did not include AWS_DEFAULT_ACL = 'public-read'```` So they were private resources. Once the permssion is set to public-read, the 403 Forbidden``` error goes away. See the docs here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 EarlyCoder