Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get this Django CSS to render properly in my production environment?
    primarykey
    data
    text
    <p>I am trying to deploy a Django application in a production environment and I can't seem to get the CSS to render properly. In my local environment it works fine. In the settings, I have set up:</p> <pre><code>STATIC_URL = '/static/' ADMIN_MEDIA_PREFIX = '/static/admin/' </code></pre> <p>On the server I've run collectstatic to gather the files into the following folder:</p> <pre><code>STATIC_ROOT = '/sites/thetweethereafter.com/public/static' </code></pre> <p>The webserver is nginx, and my nginx.conf is:</p> <pre><code>events { worker_connections 1024; } http { server { listen 80; server_name www.thetweethereafter.com; rewrite ^/(.*) http://thetweethereafter.com/$1 permanent; } server { listen 80; server_name thetweethereafter.com; access_log /sites/thetweethereafter.com/logs/access.log; error_log /sites/thetweethereafter.com/logs/error.log; location /static { autoindex on; root /sites/thetweethereafter.com/public/; } location / { proxy_pass http://127.0.0.1:29000; } } } </code></pre> <p>If I browse directly to the static files, I can get them no problem.</p> <p><a href="http://thetweethereafter.com/static/css/styles.css" rel="nofollow">http://thetweethereafter.com/static/css/styles.css</a></p> <p>However, when I load a page that references one of these files, the browser is not rendering them.</p> <p><a href="http://thetweethereafter.com" rel="nofollow">http://thetweethereafter.com</a></p> <p>I can't for the life of me figure out what I'm doing wrong. I have lots of other projects set up in a similar way and they work fine. What am I missing?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload