Where to put business logic in Django?

Hi, i am a new developmenting in django Framework. And i have a question, where must i put the factory code to generate data for models and database With Factory_boy and Faker. also, I wan to Know how run this factory in the Shell including the Imports commands. Thanks a lot