1. settings中设置一变量获取绝对路径:PROJECT_PATH = os.path.dirname(globals()["__file__"])
2. urls中设置资源路径规则:
urlpatterns = patterns('',
# Examples:
url(r'^statics/(?P.*)$', 'django.views.static.serve', {'document_root': settings.PROJECT_PATH+'/statics'})
}
3. 模板中引用资源文件: