[bug 1116489] Tweak ImportError message in manage.py

If they have a virtual environment activated, then the problem is
probably either they haven't installed the requirements or they haven't
updated them in a while.

If they don't have a virtual environment actiivated, then they need to
activate it.

This code change attempts to distinguish between the two by looking for
VIRTUAL_ENV in the environment.
This commit is contained in:
Will Kahn-Greene 2015-09-29 11:30:35 -04:00
Родитель 67b894885e
Коммит c7f483d970
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -18,7 +18,10 @@ except ImportError:
print 'OH NOES! There was an import error:'
print ''
print ''.join(traceback.format_exception(*sys.exc_info()))
print 'Have you activated your virtual environment?'
if 'VIRTUAL_ENV' in os.environ:
print 'Have you installed requirements? Are they up-to-date?'
else:
print 'Have you activated your virtual environment?'
sys.exit(1)
# Import for side-effect: configures our logging handlers.