Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ModuleNotFoundError:没有名为';mysite';当尝试呼叫django管理员时_Python_Python 3.x_Django_Django Models - Fatal编程技术网

Python ModuleNotFoundError:没有名为';mysite';当尝试呼叫django管理员时

Python ModuleNotFoundError:没有名为';mysite';当尝试呼叫django管理员时,python,python-3.x,django,django-models,Python,Python 3.x,Django,Django Models,在终端中运行命令django admin collectstatic时,我得到以下错误: ModuleNotFoundError: No module named 'mysite' 它甚至出现在列表的末尾django admincommands help Type 'django-admin help <subcommand>' for help on a specific subcommand. Available subcommands: [django] check

在终端中运行命令
django admin collectstatic
时,我得到以下错误:

ModuleNotFoundError: No module named 'mysite'
它甚至出现在列表的末尾
django admin
commands help

Type 'django-admin help <subcommand>' for help on a specific subcommand.
Available subcommands:

[django]
    check
    compilemessages
    createcachetable
    dbshell
    diffsettings
    dumpdata
    flush
    inspectdb
    loaddata
    makemessages
    makemigrations
    migrate
    runserver
    sendtestemail
    shell
    showmigrations
    sqlflush
    sqlmigrate
    sqlsequencereset
    squashmigrations
    startapp
    startproject
    test
    testserver
Note that only Django core commands are listed as settings are not properly configured (error: No module named 'mysite').
setting.py
BASE_DIR=os.path.dirname(os.path.dirname(os.path.abspath(u文件_uu)))
WSGI_应用程序='mysite.WSGI.APPLICATION'
wsgi.py
导入操作系统
从django.core.wsgi导入获取\u wsgi\u应用程序
os.environ.setdefault('DJANGO\u SETTINGS\u MODULE','mysite.SETTINGS')
application=get\u wsgi\u application()

在myside dir和myproject中创建
\uuu init\uuuuuupy
文件,而不是
django admin collectstatic
使用此命令

python manage.py collectstatic

参考此主题

我不认为
mysite
文件夹中缺少
\uuuu init\uuuuuuuuuuuuuuupy
,因为命令
django admin startproject mysite
将用默认文件构建最小的项目结构,包括
\uuuu init\uuuuuuuuuuuuuuuuuuuupy.py
,除非它被意外删除。它已在中初始化mysite文件夹,但不在myProject文件夹中
python manage.py collectstatic