I successfully deployed my Django site to IIS7 but I still have problems about how to configure IIS to serve the static files. I tried many many things from the internet but nothing seems to work. Everything is working fine on Django server ( manage.py runserver
) and with debug = True
, but as soon as I turn off debug ( debug = False
) and open it on IIS, the bootstrap css and js are not loaded.
Do you have any ideas about why I'm experiencing this behavior? Perhaps you could point me to a step-by-step guide to help me?
Right click on your website in IIS7 manager and
and here you go :)
If you are using django >= 1.3 and following the doc you are probably using the 'staticfiles' app .
/static/
and PATH /staticfiles/
(I have no experience with II7 but the conf should be straightforward) ./manage.py collectstatic
to move the static files into the correct path and you should be done...
More info on production settings here .
You also need to insert a web.config file into the static directory for IIS to serve the files.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.