Import all modules in django

There is a way in django to import all modules

   ex: from project.models import *
   ex: from project1.models import *

Is it possible to do this with a single statement

+3
source share
1 answer

If you just want to do this by checking things in the shell, take a look at the command shell_plusprovided by the django-extensions project.

This is a really neat extension that launches a shell and automatically loads all the models in your project when you run ./manage.py shell_plusfrom the command line.

+3
source

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


All Articles