My apologies if this has been answered already. I am trying to figure out how to get Django to use sqlite3 when doing automated tests through github actions, but use mssql when run locally. The reason is because well… I can’t just spin up a mssql server instance in my github actions, or not that I am aware of. Perhaps there is a better solution that gets around this problem to begin with, and I’m all ears.
The problem with this approach is that I have to type python manage.py runserver sqlite3 to get django to connect to it, which I found out the hard way, interferes with a lot of other operations, such as migrate. Is there a best practice that tackles this kind of situation?
Thank you for your prompt response. Using environment variables as the trigger point should work nicely. I heard that this should be avoided in production, though. Would you happen to have suggestions for a prod environment?
For completeness, this is the solution I came up with for now. I hope this helps someone else out in the future.
I’m not sure where you might have heard that. Using environment variables is absolutely one of the most reliable means of managing differences between deployment environments.