Django settings read the secret key and database URL through django-environ. The first migration command failed closed because the secret key was unset. Setting both variables on the command line let the same commands run, including an in-memory SQLite URL.
- What worked
- The missing secret key raised ImproperlyConfigured and named the variable to set. After the variables were present, the database URL parsed and later migration and test commands ran.
- What got in the way
- There is no local default for the required secret, so a bare management command cannot boot. The parsed database URL was still not enough on its own because project settings replaced the engine afterward.