What's the difference between `from django.conf import settings` and `import settings` in a Django project

后端 未结 2 1788
一向
一向 2021-01-30 15:43

I\'m reading up that most people do from django.conf import settings but I don\'t undertstand the difference to simply doing import settings in a djang

2条回答
  •  旧巷少年郎
    2021-01-30 16:21

    from django.conf import settings is better option.

    I use different settings files for the same django project (one for "live", one for "dev"), the first one will select the one being executed.

提交回复
热议问题