Django Console and custom settings
I have a settings module with a default.py for production, and then my localmysql.py overrriding some settings.
This works fine for unit tests and for running django, but not for manage.py tasks nor for the Django console.
I tried the DJANGO_SETTINGS_MODULE environment:
but it has no effect. It still tries to connect to the production server...
I notice in django_manage_shell, PYCHARM_DJANGO_MANAGE_MODULE is referenced, but I could not find any documentation.
How can I tell PyCharm to use settings.localmysql for manage.py and Django console?
This works fine for unit tests and for running django, but not for manage.py tasks nor for the Django console.
I tried the DJANGO_SETTINGS_MODULE environment:
>>> os.getenv("DJANGO_SETTINGS_MODULE","")
'settings.localmysql'
but it has no effect. It still tries to connect to the production server...
I notice in django_manage_shell, PYCHARM_DJANGO_MANAGE_MODULE is referenced, but I could not find any documentation.
How can I tell PyCharm to use settings.localmysql for manage.py and Django console?
Please sign in to leave a comment.
settings\localmysql.py should be settings.localmysql
That is not possible to enter though... :-(
I have the same issue here. I tried to set the DJANGO_SETTINGS_MODULE environment variable in the Django Console settings tab with no success. I assume something in django_manage_shell.run does not respect this variable and the corresponding settings in the Django integration tab too.