2

I'm getting an error when trying to serve static file on IIS using FastCGI with Django==2.2.5 and python==3.7.4 my settings.py

static code

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR,  'static')

I'm using wfastcgi version 3.0.0 and my server is windows server 2012 datacenter R2. I tried all solution here Django Admin Page missing CSS in IIS and here How to fetch static CSS files with django on IIS? and watched some tutorial on youtube but still stuck with that.

The error when it shows when I'm trying to access the admin page

GET http://xxxxxx/static/admin/css/base.css net::ERR_ABORTED 404 (Not Found)

Qais Bsharat
  • 146
  • 3
  • 12

1 Answers1

1

It's difficult to figure what your environment situation may be, but you may me missing a Virtual link to your static directory in IIS. Also, you will need a web.config in your static directory. Your project will require a total of two web.config files.

Here is an example of what your static directory should look like https://github.com/Johnnyboycurtis/webproject/tree/master/static

You can review that project and follow along in the tutorial Deploy Django on Windows using Microsoft IIS

Jon
  • 2,373
  • 1
  • 26
  • 34