django的编码规范

settings.py中要使用相对路径:
import os
DIRNAME = os.path.dirname(__file__)# 1)去掉文件名的路径 2)__file__为本settings.py文件
MEDIA_ROOT = os.path.join(DIRNAME, '静态路径')

网站目录规范:
example.com/
   -README
   -settings.py
   -urls.py
   -APP1/
   -APP2/
   +docs/
       #This will hold the documentation for your project
   +static/
       #In production this will be the root of your MEDIA_URL
       +css/
       +js/
       +images/
   +tests/
       #Project level tests (Each app should also have tests)
   +uploads/
       +content imgs, etc
   +templates/
       #This area is used to override templates from your reusable apps
       +flatpages/
       +comments/
       +example/
       +app1/
       +app2/

posted @ 2009-11-04 11:27  kid的笔记本  阅读(368)  评论(0编辑  收藏  举报