mengzhuo
V2EX  ›  Django

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

  •  
  •   mengzhuo · Mar 13, 2013 · 5160 views
    This topic created in 4801 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
        1
    Candyhorse  
       Mar 13, 2013
    就是存储些设置嘛,直接存在文件里边也行啊 ~ 读写文件就行
    G2bN4dbX9J3ncp0r
        2
    G2bN4dbX9J3ncp0r  
       Apr 7, 2013
    yaml ini 啥的配置文件
    huacnlee
        3
    huacnlee  
       Apr 7, 2013
    too
        4
    too  
       Apr 9, 2013
    帮楼主贴下连接。还没用试过,不过看起来值得试试。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   781 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 19:52 · PVG 03:52 · LAX 12:52 · JFK 15:52
    ♥ Do have faith in what you're doing.