django change settings at runtime 1

django change settings at runtime

import django.conf as conf

conf.settings.DATABASES['default']['NAME'] = 'novo_banco'

Here is what the above code is Doing:
1. Importing the django.conf module
2. Getting the settings object from the django.conf module
3. Changing the NAME value in the DATABASES dictionary

Similar Posts