[Python-modules-team] Bug#755602: Fails to build with Django 1.7

Raphael Hertzog hertzog at debian.org
Thu Aug 7 20:23:17 UTC 2014


Control: tag -1 + confirmed

The package fails to build with Django 1.7:

   debian/rules override_dh_auto_test
make[1]: Entering directory '/«PKGBUILDDIR»'
set -e; \
for python in python2.7; do \
        PYTHONPATH="." $python runtests.py; \
done
Using Python version 2.7.8 from /usr/bin/python2.7
Using Django version 1.7c2 from /usr/lib/python2.7/dist-packages/django
Traceback (most recent call last):
  File "runtests.py", line 48, in <module>
    call_command('syncdb', verbosity=1, interactive=False)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 93, in call_command
    app_name = get_commands()[name]
  File "/usr/lib/python2.7/dist-packages/django/utils/lru_cache.py", line 101, in wrapper
    result = user_function(*args, **kwds)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 73, in get_commands
    for app_config in reversed(list(apps.get_app_configs())):
  File "/usr/lib/python2.7/dist-packages/django/apps/registry.py", line 137, in get_app_configs
    self.check_apps_ready()
  File "/usr/lib/python2.7/dist-packages/django/apps/registry.py", line 124, in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
make[1]: *** [override_dh_auto_test] Error 1


To go past this error you need to add this to your test script:

import django
if hasattr(django, 'setup'):
    django.setup()


Cheers,

-- 
Raphaël Hertzog ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/



More information about the Python-modules-team mailing list