Django 1.3 static files placed in application dirs

前端 未结 1 1962
抹茶落季
抹茶落季 2020-12-29 13:00

I\'m using Django 1.3 and the static files in app is confusing. What I was doing: 1) Set the

STATIC_ROOT = as path to directory \'static\' in my project
STA         


        
相关标签:
1条回答
  • 2020-12-29 13:39

    The idea behind that is that you ship all your apps with their own static files under app/static.

    Once you deploy an app in a project, running python manage.py collectstatic will copy all static files found thanks to STATICFILES_FINDERS setting (which contains a finder looking for a static dir in each installed app by default) within your STATIC_ROOT directory then will be served via STATIC_URL

    The development server handles that STATIC_URL pattern when in DEBUG mode but this is an interesting read : Serving static files in production

    0 讨论(0)
提交回复
热议问题