?????????????????????????? _after ?????︳????ɡ?
?????????????????????????????????????????????????????????????Щ?????????????????????????????????????????????????????????£?
class _AfterMeta(type):
def __init__(cls?? name?? bases?? dct):
super(_AfterMeta?? cls).__init__(name?? bases?? dct)
cls._after(dct)
class Config(object):
__metaclass__ = _AfterMeta
ROOT_PATH = '/'
LOGIN_PATH = ROOT_PATH + 'login'
SCHEME = 'http'
DOMAIN = 'localhost'
ROOT_URL = '%s://%s%s' % (SCHEME?? DOMAIN?? ROOT_PATH)
@classmethod
def _after(cls?? own_attrs):
if 'LOGIN_PATH' not in own_attrs and 'ROOT_PATH' in own_attrs:
cls.LOGIN_PATH = cls.ROOT_PATH + 'login'
if 'ROOT_URL' not in own_attrs and ('SCHEME' in own_attrs or 'DOMAIN' in own_attrs or 'ROOT_PATH' in own_attrs):
cls.ROOT_URL = '%s://%s%s' % (cls.SCHEME?? cls.DOMAIN?? cls.ROOT_PATH)
????????????????????????????????????д???????鷳???????????и??y?????????????????ò???????????д??ε???????
???????????????????????????????飬???????????????????????????????????????????????????
?????????·????????????????????????
?????????????????????????????????????÷??????????????? link ??????????м????
.
?????? config
?????? __init__.py
?????? default.py
?????? development.py -> private/development.py
?????? development_sample.py
?????? private (cloned from another private repository)
??   ?????? development.py
??   ?????? production.py
?????? production.py -> private/production.py
?????? production_sample.py
????????????????????????????е?????????????? .gitignore ??
?????????????????????????? Redis ?У???????????? rdb ??????ɡ????????????????????????????????????????????????? Dropbox?????? Dropbox ????????????????? link ??????????????????????
????doodle
?????????? data
?????????? redis -> ~/Dropbox/doodle/redis
???????????????и????Dropbox ????????б????????????????е?????汾???????????