manage.py
文件,查看文件发现文件中含有if __name__ = __main__
,这个文件肯定是有备用供程序当模块使用的功能>>> from blog.models import Person
django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS,
but settings are not configured. You must either define the environment variable
DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
manage.py
,调用main()
函数,配置环境及安装APP >>> import manage
>>> manage.main()
自动完成配置信息>>> from blog.models import Person
>>>
python verson 3.7
django verson 3.0