Opened 9 years ago

Closed 9 years ago

#26484 closed Cleanup/optimization (fixed)

Add a helpful message in manage.py when Django cannot be imported

Reported by: Tim Graham Owned by: nobody
Component: Core (Other) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As discussed on a pull request and on django-developers.

The first commit is 724a279849a5cd09cdb5ef201fe6958a4c26fe73 but the issue is reopened after some concerns about the possibility of masking imports on Python 2.

Change History (5)

comment:1 by Tim Graham, 9 years ago

Has patch: set

I implemented Shai's suggestion to catch the original exception, then try import django and display the helpful message if that fails or reraise the original exception if not.

comment:2 by Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Tim Graham, 9 years ago

In 724a279849a5cd09cdb5ef201fe6958a4c26fe73:

Raised a more helpful ImportError message in manage.py template.

comment:4 by Tim Graham <timograham@…>, 9 years ago

In 5c6d397:

Refs #26484 -- Avoided masking useful exceptions in manage.py's ImportError.

comment:5 by Tim Graham, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top