`
wtm_mac
  • 浏览: 87073 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

django1.3指定static静态资源目录

阅读更多
1、修改settings.py如下
import os
# Additional locations of static files
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(os.path.dirname(__file__), 'static').replace('\\','/'),
)

2、根目录下创建static目录
3、启动后可直接访问/static/ 下的资源
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics