Problem in documentation "Writing your first Django app, part 1" with manage.py runserver
|Reported by:||anonymous||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The documentation at https://docs.djangoproject.com/en/1.4/intro/tutorial01/ "Writing your first Django app, part 1" explains how to start the development server using
python manage.py runserver
However on systems where python3 is the default python interpreter, one gets an error like the following:
# 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 ImportError: No module named 'django'
It works fine if one runs
python2 manage.py runserver
Now to avoid confusion, since it is not always clear on the first sight, what interpreter runs and since the documentation gives no hint about, that you have to run manage.py with python2, it would be better if it told the new user to run the script itself, since the shebang line states the correct interpreter already.
Therefore the documentation could be canged to
chmod +x manage.py ./manage.py runserver
and everything should work as expected without python2/3 confusion.