Management Proctype
cdcarter opened this issue · 0 comments
cdcarter commented
When we connect one-off dynos to MetaCI production (for example, to run a query in the python shell), it uses the standard production.py settings for the session. The most obvious "symptom" that made me want to write this ticket is that means exceptions in the shell cause logs to sentry. That's waste.
But, there are a few good reasons to run one-off dynos with different django settings. We should create a new django settings file, managementcommands.py
, and add new line in the Procfile:
management: DJANGO_SETTINGS_MODULE=config.settings.managementcommands python manage.py
Then, we can execute commands in one-off dynos with heroku run management < shell | collect_static | whatever >
and they'll get executed with the other settings module.
Things to change:
- disable logging to sentry
- audit lines to system logger, or something?
- eventually: use a different db credential
Original IMs
but yes, i suggest we should probably create a Procfile entry on all apps that is `manage:
ENV_VARFOR_SETTINGS=management.py python manage.py` or something
so we can `heroku run manage shell`
and have it be running under a different db credential, a different logging policy, etc...
David liked this