Django template can't see CSS files

前端 未结 5 654
北恋
北恋 2021-01-30 09:25

I\'m building a django app and I can\'t get the templates to see the CSS files... My settings.py file looks like:

MEDIA_ROOT = os.path.join(os.path.abspath(os.p         


        
5条回答
  •  走了就别回头了
    2021-01-30 10:02

    It also worked for me, thanks guys !!

    settings.py

    MEDIA_ROOT = '/home/pi/ewspaces/ws-classic/xima/media'
    
    MEDIA_URL = '/statics/'
    

    urls.py

    if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^statics/(?P.*)$', 'django.views.static.serve',  
         {'document_root':     settings.MEDIA_ROOT}),
    )
    

    inside templates:

    
    

提交回复
热议问题