Gunicorn will only serve the dynamic content, i.e. the Django files. So you need to setup a proxy server such as nginx to handle the static content (your CSS files). I assume you are starting Gunicorn the right way, so you just need to configure nginx to serve the static files. You can use a configuration like the following, where you just need to change the path to your static files:
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
proxy_pass http://127.0.0.1:8000;
}
location /static {
autoindex on;
alias /path/to/staticfiles;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
Even if this configuration is setup, you have to call "./manage.py collectstatic" to make your css work
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…