Django - warn user before migrating

I am writing a django model migration that will delete all existing objects (models) in the database.
Can I warn the user before the actual migration? I want to remind the user to back up data before performing the migration.

Is it possible to take a raw_input()from the user and then continue if he really wants to?

How do I cancel a transition at runtime?

+4
source share
1 answer

You can do whatever you want in RunPython, which includes a user input request and creating an exception to cancel the migration.

, . , RunPython, , . , , .

+3

Source: https://habr.com/ru/post/1605716/


All Articles