Opened 4 years ago

Closed 4 years ago

#16616 closed Bug (worksforme)

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

Reported by: velmont Owned by: nobody
Component: Core (Management commands) Version: master
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


Always after doing 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 Changed 4 years ago by aaugustin

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

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/ does:

./django/bin/!/usr/bin/env python
./django/bin/!/usr/bin/env python
./django/bin/profiling/!/usr/bin/env python
./django/bin/!/usr/bin/env python
./django/conf/project_template/!/usr/bin/env python
./django/contrib/admin/static/admin/js/!/usr/bin/env python
./extras/!/usr/bin/env python
./tests/!/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 4 years ago by aaugustin (next)
Note: See TracTickets for help on using tickets.
Back to Top