Bug 1029236

Summary: Update django-admin.py to reflect python3 rather than ssytem python (version 2)
Product: [Fedora] Fedora Reporter: Matt Wilmott <mattwilmott>
Component: python-djangoAssignee: Matthias Runge <mrunge>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: bkabrda, mhroncok, michel, mrunge
Target Milestone: ---   
Target Release: ---   
Hardware: noarch   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-21 10:07:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Matt Wilmott 2013-11-11 23:42:23 UTC
Description of problem:
/usr/lib/python3.3/site-packages/django/bin/django-admin.py has the following interpreter defined '#!/usr/bin/env python' however on Fedora 19 the default Python version is 2 therefore it fails to execute as django libraries cannot be found

Version-Release number of selected component (if applicable): 
Fedora release 19 (Schrödinger’s Cat)
python3-django-1.5.4-1.fc19.noarch

How reproducible:
Always

Steps to Reproduce:
1. Run /usr/lib/python3.3/site-packages/django/bin/django-admin.py


Actual results:
$ /usr/lib/python3.3/site-packages/django/bin/django-admin.py
Traceback (most recent call last):
  File "/usr/lib/python3.3/site-packages/django/bin/django-admin.py", line 2, in <module>
    from django.core import management
ImportError: No module named django.core


Expected results:

$ /usr/lib/python3.3/site-packages/django/bin/django-admin.py
Usage: django-admin.py subcommand [options] [args]

Options:
  -v VERBOSITY, --verbosity=VERBOSITY
                        Verbosity level; 0=minimal output, 1=normal output,
                        2=verbose output, 3=very verbose output
  --settings=SETTINGS   The Python path to a settings module, e.g.
                        "myproject.settings.main". If this isn't provided, the
                        DJANGO_SETTINGS_MODULE environment variable will be
                        used.
...


Additional info:
If the script is updated to reflect '#!/usr/bin/env python3' it works as expected.

Also can
ln -s /usr/lib/python3.3/site-packages/django/bin/django-admin.py /usr/bin/django-admin.py
be added to the rpm script so its immediately available on the path?

Comment 1 Matthias Runge 2013-11-21 10:07:30 UTC
the script is not meant to be called directly, please use python3-django-admin instead, which works as expected.