Changing Django settings at runtime

前端 未结 7 1268
-上瘾入骨i
-上瘾入骨i 2020-11-30 05:09

I\'d like to expose some (app-specific) settings to the admin interface, so users can change them comfortably and also not have to restart Django.

How should I go ab

7条回答
  •  独厮守ぢ
    2020-11-30 05:59

    You can use recomended .configure() method of settings module:

    from django.conf import settings
    settings.configure(DEBUG=True)
    

    settings module has additional handy features. Check docs.

提交回复
热议问题