django DEBUG=False 加载静态资源

2018-08-30  本文已影响0人  Jedore

Serving the site and your static files from the same server

If you want to serve your static files from the same server that’s already serving your site, the process may look something like:

  • Push your code up to the deployment server.
  • On the server, run collectstatic to copy all the static files into STATIC_ROOT.
  • Configure your web server to serve the files in STATIC_ROOT under the URL STATIC_URL.

You’ll probably want to automate this process, especially if you’ve got multiple web servers.

上一篇 下一篇

猜你喜欢

热点阅读