Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7686745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:32:57+00:00 2026-05-31T19:32:57+00:00

I am trying to deploy a Django application in a production environment and I

  • 0

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:

STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/static/admin/'

On the server I’ve run collectstatic to gather the files into the following folder:

STATIC_ROOT = '/sites/thetweethereafter.com/public/static'

The webserver is nginx, and my nginx.conf is:

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;
      }
    }
}

If I browse directly to the static files, I can get them no problem.

http://thetweethereafter.com/static/css/styles.css

However, when I load a page that references one of these files, the browser is not rendering them.

http://thetweethereafter.com

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:32:59+00:00Added an answer on May 31, 2026 at 7:32 pm

    Inspecting your website index I noticed the css files are served as “text/plain” instead of “text/css” file type. So the problem should rely in the server configuration.

    Nginx has to know which mime type apply according to the file extension. On a fresh debian install there is an include directive in the http section like this :

    http {
    [...]
       include /etc/nginx/mime.types;
    [...]
    }
    

    That should do the trick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to deploy my django application to VPS but I get 505-
I'm trying to deploy a django application for production on apache mod-wsgi. I have
Im trying to deploy my django and I always get one of these erros:
I'm trying to deploy a django app with fabric and get the following error:
I'm trying to setup Fabric so that I can automatically deploy my Django app
Hi im trying to deploy my django application on heroku , i am having
So I am trying to deploy to my production environment and am getting 500
Trying to deploy application using ClickOnce to a webserver running sharepoint. I can publish
I'm trying to deploy my Django application on my linode server with apache and
I'm trying to deploy my Django application to an Apache2 based server with mod_python.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.