[1.7.x] Fixed #22983: Alert when squashing RunPython operations with referred functions.
[1.7.x] Removed extra newline.

Backport of b48c2c5925 from master
[1.7.x] Checked more precisely whether the app registry is ready.

Accounted for the three stages of population: app configs, models,
ready() methods of app configs.

Backport of a764a9cc from master
[1.7.x] Fixed #22939 -- Delayed admin_static backend detection

Thanks generalov for the report.

Backport of 22b2fb0b from master