Where should I put Django pre-flight checks that access the database?

I have a Django app that requires certain items to be in the database before it will run. I'd like to add checks at start time that will fail if these items are not found in the database.

Is there a way to integrate these checks into the Django system check framework? I've played with this but I'm not sure if this is appropriate where the check makes database queries.

And if this isn't the right place, is there a better way? I only need these checks to run once, before or at startup time.

Вернуться на верх