How to solve SyntaxError on autogenerated manage.py?

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

    I had this issue (Mac) and followed the instructions on the below page to install and activate the virtual environment

    https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/

    $ cd [ top-level-django-project-dir ]

    $ python3 -m pip install --user virtualenv

    $ python3 -m venv env

    $ source env/bin/activate

    Once I had installed and activated the virtual env I checked it

    $ which python

    Then I installed django into the virtual env

    $ pip install django

    And then I could run my app

    $ python3 manage.py runserver

    When I got to the next part of the tutorial

    $ python manage.py startapp polls

    I encountered another error:

         File "manage.py", line 16
    
       ) from exc
                ^
    
       SyntaxError: invalid syntax
    

    I removed

    from exc
    

    and it then created the polls directory

提交回复
热议问题