sot / kadi

Chandra commands and events
https://sot.github.io/kadi
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Make sure django is loaded if it is not already loaded #202

Closed javierggt closed 2 years ago

javierggt commented 3 years ago

Description

This PR would Fix #201.

The way it is currently set up, kadi loads django if the DJANGO_SETTINGS_MODULE is not defined. The assumption is that, because django sets this variable during loading, if it is defined it means django is loaded. This fails when a child process is spawned, because the variable will be defined for children processes, but the children processes do no inherit the python module.

I added another condition for loading django. Namely, that the manvrs variable is not defined within kadi.events.

Possible things to do:

Testing

Fixes #

jeanconn commented 3 years ago

I think this PR has been lingering and might be useful. @taldcroft did you have thoughts for more testing? Largely I'm just wondering which open or merged PRs should really just get in to a ska3-matlab without much fuss.