How to solve SyntaxError on autogenerated manage.py?

前端 未结 30 2204
囚心锁ツ
囚心锁ツ 2020-11-28 08:24

I\'m following the Django tutorial https://docs.djangoproject.com/es/1.10/intro/tutorial01/

I\'ve created a \"mysite\" dummy project (my very first one) and try to

30条回答
  •  感动是毒
    2020-11-28 08:55

    The solution is straightforward. the exception from manage.py is because when running the command with python, Django is unable to predict the exact python version, say you may have 3.6, 3.5, 3.8 and maybe just one of this versions pip module was used to install Django to resolve this either use:

    ./manage.py `enter code here`
    

    or using the exact python version(x.x) stands:

    pythonx.x manage.py 
    

    else the use of virtual environments can come in handy because its relates any pip django module easily to python version

    • create env with pyenv or virtualenv
    • activate (e.g in virtualenv => virtualenv env)
    • run using python manage.py command

提交回复
热议问题