api – Django wrap SQL as Command

i have a question,

is it possible to wrap a SQL command on Django Command ?

because i have this SQL, that need to be executed during deploy

update car
join car_manager manager_before 
on car.manager_id = manager_before.id and manager_before.shortname is null
join car_manager manager_after 
on manager_after.name = manager_before.name and manager_after.shortname is not null
set car.manager_id = manager_after.id