Opened 12 years ago

Closed 12 years ago

#19841 closed Uncategorized (needsinfo)

Problem in documentation "Writing your first Django app, part 1" with manage.py runserver

Reported by: anonymous Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (2)

comment:1 by Aymeric Augustin, 12 years ago

This is a problem with your installation of Django.

How did you install it?

comment:2 by Tim Graham, 12 years ago

Resolution: needsinfo
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top