How import models in python script django ?

Ah, ok. To rephrase it slightly, you want access to the Django ORM for a script you’re going to run from the command line.

What you’re looking for in this case is how to write Custom django-admin commands.

The reason for this is that Django models are not regular Python classes. There’s a lot of behind-the-scenes work being done to convert those models into the actual classes you use within your Django code. So, for you to have access to those models, your script needs to (effectively) start the Django environment and build those classes before your script can use them.