慕盖茨3205560
2020-04-08 11:38
D:\DjangoProject\django_introduction>python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 14, in <module>
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
运行了,还是不行,删除了除conda意外的python,避免了冲突问题,也还是不行
'conda' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
?
原来在DOS环境下需要先执行: conda activate命令,然后再执行 python manage.py runserver就可以了。
如下:
D:\DjangoProject\django_introduction>conda activate
(base) D:\DjangoProject\django_introduction>python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
You have 15 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
April 08, 2020 - 11:39:34
Django version 2.1, using settings 'django_introduction.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
三小时带你入门Django框架 新版上架
25587 学习 · 248 问题
相似问题