Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#18124 closed Bug (needsinfo)

manage.py has /usr/bin/python hardwired

Reported by: Roy Smith Owned by: nobody
Component: Uncategorized 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

When you run "django-admin startproject", the generated manage.py starts with "#!/usr/bin/python". This doens't play well with virtualenv. It should start with "#!/usr/bin/env python".

Change History (5)

comment:1 Changed 4 years ago by Carl Meyer

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: needsinfo
Status: newclosed

I can't reproduce this - the manage.py in the project template in Django (at django/conf/project_template/manage.py) has #!/usr/bin/env python (and has had that ever since 2005 when manage.py was first introduced), and that's what I get in the generated manage.py of a new project.

What's the source of your Django installation? Is it possible that someone (e.g. an OS distributor) has patched it?

comment:2 Changed 4 years ago by Roy Smith

Hmmm, looks like this was out of a Ubuntu package. Thanks for the quick response. My apologies for the false report.

comment:3 in reply to:  2 Changed 4 years ago by Carl Meyer

Replying to RoySmith:

Hmmm, looks like this was out of a Ubuntu package. Thanks for the quick response. My apologies for the false report.

No problem, thanks for taking the time to make the report. Please do file this with Ubuntu, if you don't mind - they should not be patching manage.py in that way.

comment:4 Changed 4 years ago by Roy Smith

Heh, this is even more perverse than it appears at first glance. I did "pip install django==1.4" and activated my virtualenv. So, I should be getting the django-admin.py out of my virtualenv, right? I mean, it's on my PATH before the Ubunu-installed copy that's in /usr/bin, right? Yes, except that the copy that Ubunu installs in /usr/bin is "django-admin", not "django-admin.py", so when I typed "djan<tab>", it auto-expanded to "django-admin" and I never noticed the ".py" was missing.

Sigh.

comment:5 in reply to:  4 Changed 4 years ago by Ramiro Morales

Replying to RoySmith:

Heh, this is even more perverse than it appears at first glance. I did "pip install django==1.4" and activated my virtualenv. So, I should be getting the django-admin.py out of my virtualenv, right? I mean, it's on my PATH before the Ubunu-installed copy that's in /usr/bin, right? Yes, except that the copy that Ubunu installs in /usr/bin is "django-admin", not "django-admin.py", so when I typed "djan<tab>", it auto-expanded to "django-admin" and I never noticed the ".py" was missing.

Sigh.

Do note that Django documentation directs users to use django-admin.py startproject and not django-admin startproject.

Note: See TracTickets for help on using tickets.
Back to Top