在运行envirtual环境创建项目,python manage.py migrate同步数据库问题

时间:2021-04-16 18:02:33
(test1) [hy2@centos-linux blog]$ python manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 17, in <module>
    "Couldn't import Django. Are you sure it's installed and "

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?

1,workon test1

登录环境、

2,pip uninstall django,

卸载django

3,如果没有,就pip install django

最后重新执行一次 python manage.py migrate

python manage.py runserver问题

4,pip uninstall django

virtualenv
python_env
source
.
/python_env/bin/activate
pip
install Django
==1.5.4
python
manage.py runserver
这样问题就解决了
注意:参考网址:http://db.vsyour.com/thread-970-1-1.html