How to solve SyntaxError on autogenerated manage.py?

前端 未结 30 1939
囚心锁ツ
囚心锁ツ 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:56

    Have you entered the virtual environment for django? Run python -m venv myvenv if you have not yet installed.

    0 讨论(0)
  • 2020-11-28 08:57

    For future readers, I too had the same issue. Turns out installing Python directly from website as well as having another version from Anaconda caused this issue. I had to uninstall Python2.7 and only keep anaconda as the sole distribution.

    0 讨论(0)
  • 2020-11-28 08:58

    Solved my problem too when I activated my virtual environment using:

    source bin/activate
    
    0 讨论(0)
  • 2020-11-28 09:01

    I had the exact same error, but then I later found out that I forget to activate the conda environment which had django and other required packages installed.

    Solution: Create a conda or virtual environment with django installed, and activate it before you use the command: $ python manage.py migrate

    0 讨论(0)
  • 2020-11-28 09:02

    Its a simple solution actually one i just ran into. Did you activate your virtual environment?

    my terminal screenshot

    0 讨论(0)
  • 2020-11-28 09:03

    Just do:

    pipenv shell

    then repeat:

    python manage.py runserver

    and don't delete from exc as suggested above.

    cheers!

    0 讨论(0)
提交回复
热议问题