How to fetch static CSS files with django on IIS?

前端 未结 2 738
春和景丽
春和景丽 2020-12-05 23:34

I have django installed on IIS8. Now I want to configure it to serve static files. I have been following this tutorial

I have added this to settings.py

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-06 00:17

    Yura's answer is quite complete. I had another approach, thought.

    Right click the website and go to add application, enter the alias(used 'static') and then enter the physical path to your static files folder. Press OK.
    Now, the tricky part, in the application you created for the static folder, go to the handle mapping and delete the mapping to the FastCGI site handler. Enter your site, it works!

    It's pretty similar to Yura's answer, but uses the IIS interface instead of writing a web.config file by yourself.

提交回复
热议问题