#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 by , 13 years ago
Resolution: | → needsinfo |
---|---|
Status: | new → closed |
follow-up: 3 comment:2 by , 13 years ago
Hmmm, looks like this was out of a Ubuntu package. Thanks for the quick response. My apologies for the false report.
comment:3 by , 13 years ago
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.
follow-up: 5 comment:4 by , 13 years ago
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 by , 13 years ago
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
.
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?