Opened 13 years ago

Closed 13 years ago

#16616 closed Bug (worksforme)

startproject should use virtualenv compatible /usr/bin/env python hashbang for manage.py

Reported by: Odin Hørthe Omdal Owned by: nobody
Component: Core (Management commands) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Always after doing django-admin.py startproject test I need to change #!/usr/bin/python to #!/usr/bin/env python in order for it to work without problem with virtualenv.

Using #!/usr/bin/env python as a hashbang is a very common idiom in python, and I believe there shouldn't be any problems using that.

Change History (1)

comment:1 by Aymeric Augustin, 13 years ago

Resolution: worksforme
Status: newclosed

I found only one instance of #!/usr/bin/python in the current source tree, and it's an example in the fastcgi docs:

./docs/howto/deployment/fastcgi.txt:    #!/usr/bin/python

All the other files use #!/usr/bin/env python, in particular project_template/manage.py does:

./django/bin/daily_cleanup.py:#!/usr/bin/env python
./django/bin/django-admin.py:#!/usr/bin/env python
./django/bin/profiling/gather_profile_stats.py:#!/usr/bin/env python
./django/bin/unique-messages.py:#!/usr/bin/env python
./django/conf/project_template/manage.py:#!/usr/bin/env python
./django/contrib/admin/static/admin/js/compress.py:#!/usr/bin/env python
./extras/csrf_migration_helper.py:#!/usr/bin/env python
./tests/runtests.py:#!/usr/bin/env python

Either you're using an old version of Django where this problem existed, or you packaging / distribution tools change the hash bang.

Version 0, edited 13 years ago by Aymeric Augustin (next)
Note: See TracTickets for help on using tickets.
Back to Top