I have 2 settings file (settings.py for my localserver) and (live_settings.py for my live_server).
Starting the shell using python manage.py shell in cmd
When i start the shell in my command prompt it takes settings.py by default, how can i set it to live_settings.py and then start the python shell.
You could start a normal shell (i.e. just typing
pythonin your projct directory rather than using themanage.pyhelper). and manually set it up with your Django config like soThis worked for me. I’ve not used Django in a while now so things might have changed.
Alternatively, you could pass the
live_settings.pyas the parameter to the--settingsoption tomanage.py. SoYou can also simply set the
DJANGO_SETTINGS_MODULEenvironment variable to the name of thelive_settings.pymodule and launchmanage.pywith that. Remember that for the last two approaches, you need to pass the module name as Python would understand it rather than the file name.