Code

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#18124 closed Bug (needsinfo)

manage.py has /usr/bin/python hardwired

Reported by: RoySmith 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".

Attachments (0)

Change History (5)

comment:1 Changed 2 years ago by carljm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to needsinfo
  • Status changed from new to closed

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 follow-up: Changed 2 years ago by RoySmith

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 2 years ago by carljm

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 follow-up: Changed 2 years ago by 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.

comment:5 in reply to: ↑ 4 Changed 2 years ago by ramiro

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.