Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
469 views
in Technique[技术] by (71.8m points)

python - What are the problems with loading CSS and JS from Django to IIS7?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Right click on your website in IIS7 manager and

  1. add a virtual directory
  2. name it with the same name of your folder you want IIS to handle. lets say static
  3. add the path to your real static folder in your application mine was in myproject/static then ok

and here you go :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...