Changing Django settings at runtime

前端 未结 7 1263
-上瘾入骨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 06:10

    DATABASES is a dict. So you can manipulate how a dictionary:

    import django.conf as conf
    
    conf.settings.DATABASES['default']['NAME'] = 'novo_banco'
    
    0 讨论(0)
提交回复
热议问题