简体   繁体   中英

Nginx + gunicorn + django

Using this stack is giving me problems with django compressor and less static files. If I run the django dev server behind nginx there is no problem. If I try gunicorn, I get errors from gunicorn saying it can't find the less files. Why would gunicorn be looking for static files?

You need to somehow map the static files in gunicorn, too. In uwsgi the directive would be

static-map /static=/var/www/your-project/static

I think the problem is that Gunicorn cannot access the static files itself, because the routes do only exist at the Nginx level. You have to tell it where the files are.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM