django : Serving static files through nginx

后端 未结 5 1809
醉话见心
醉话见心 2020-12-04 09:40

I\'m using apache+mod_wsgi for django.
And all css/js/images are served through nginx.
For some odd reason, when others/friends/colleagues try accessing

5条回答
  •  眼角桃花
    2020-12-04 10:19

    MEDIA_URL shall not be used to serve the Static content like js etc. Django provides a separate STATIC_URL settings option that can be used.

    So this can be changed as

    
    

    Also, its more standard to use staticfile app templatetag like this:

    {% load static from staticfiles %}
    
    

    Docs Here

提交回复
热议问题