Code

Opened 3 years ago

Closed 3 years ago

#16616 closed Bug (worksforme)

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

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

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.

Attachments (0)

Change History (1)

comment:1 Changed 3 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/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 3 years ago by aaugustin (next)

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.