mengzhuo
V2EX  ›  Django

如何创建优雅添加站点设置

  •  
  •   mengzhuo · Mar 13, 2013 · 5625 views
    This topic created in 4989 days ago, the information mentioned may be changed or developed.
    有些设置必须写在管理后台(比如站点定时让客户端更新的时间),但新写一个model很不划算,而且每次只取第一个值在代码里看着都恶心

    各位大牛有什么比较好的方案???
    Supplement 1  ·  Apr 6, 2013
    Django Options搞定了
    Supplement 2  ·  Apr 10, 2013
    我的解决方案地址:https://github.com/joke2k/django-options.git
    4 replies  •  1970-01-01 08:00:00 +08:00
    Candyhorse
    Candyhorse
    Mar 13, 2013
    1
    就是存储些设置嘛,直接存在文件里边也行啊 ~ 读写文件就行
    G2bN4dbX9J3ncp0r
    G2bN4dbX9J3ncp0r
    Apr 7, 2013
    2
    yaml ini 啥的配置文件
    huacnlee
    huacnlee
    Apr 7, 2013
    3
    too
    too
    Apr 9, 2013
    4
    帮楼主贴下连接。还没用试过,不过看起来值得试试。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4062 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 07:58 · PVG 15:58 · LAX 23:58 · JFK 02:58
    ♥ Do have faith in what you're doing.