开发者

Import all modules in django

开发者 https://www.devze.com 2023-01-11 22:48 出处:网络
In django is there way to import all modules ex: from project.models import * ex: from project1.models import *开发者_运维问答

In django is there way to import all modules

   ex: from project.models import *
   ex: from project1.models import *开发者_运维问答

Can this be done with one statement


If you just want to do this when testing things in the shell, look into the shell_plus command provided by the django-extensions project.

This is a really neat extension, which starts a shell and automatically loads all the models in your project when you do ./manage.py shell_plus from the command line.

0

精彩评论

暂无评论...
验证码 换一张
取 消