Resolved by changing nginx config file from above to this:
location /static {
root /home/www/wcsdg/main;
}
On Wednesday, August 18, 2021 at 8:03:00 AM UTC-5 Scott Zimmerman wrote:
>
> I deployed django + nginx + gunicorn, and DEBUG = True. Nginx/error.log
> shows that my problem finding static files is a concatenation mistake (caps
> added)...
>
> "/home/www/wcsdg/main/STATIC/STATIC/main/styles.css" failed (2: No
> such file or directory),
> It should instead search for...
>
> "/home/www/wcsdg/main/static/main/styles.css"
>
> But there are 3 places where "static" is configured and I don't know what
> I'm doing wrong:
>
> In settings.py...
>
> STATIC_URL = '/static/'
> STATIC_ROOT = '/home/www/wcsdg/main/static'
>
> In /etc/nginx/sites-available/wcsdg...
>
> location /static {
> root /home/www/wcsdg/main/static;
> }
>
> I also added whitenoise as an app in settings.py and restarted nginx and
> gunicorn but it didn't help.
>
> Any advice?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/0ced050a-9b98-42db-8d74-2c43491ecb82n%40googlegroups.com.