2

I'm upgrading a Django 1.4.12 app to Django 1.8.2

Running

 python manage.py runserver

Or any other manage.py command hangs with no error.

Other things I tried:

--verbosity 3
-Wall

None of which gives me any feebdack and all of which hang (-Wall prints a list of warning coming from matplotlib, but nothing else).

Any idea how I can start debugging this problem?

I'm using a virtualenv and Canopy python on Mac OSX.

UPDATE

I upgraded release by release and:

  • it works with 1.5, 1.6
  • it stops working on 1.7 and up.

In 1.7 and up I get the error:

django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.

So I add:

import django
django.setup()

in the models.py that raises the error.

Could it have something to do with that?

gozzilli
  • 8,089
  • 11
  • 56
  • 87
  • What does `python manage.py check` say? And what about starting `shell`? – Blackeagle52 Jun 05 '15 at 09:38
  • 1
    Did you update in one go (1.4 to 1.8) or step by step (1.4 -> 1.5 -> ... -> 1.8)? If in one step, restore to the backup and try it from release to release. Otherwise there are too many changes between those versions to make it simple to pinpoint migration issues. – sthzg Jun 05 '15 at 09:40
  • @Blackeagle52 ``check`` hangs like every other ``manage.py`` command. @sthzg Yes, I upgraded directly. I can certainly go back and do step-by-step, but since they are two LTS releases they should have a direct upgrade method. – gozzilli Jun 05 '15 at 11:52
  • Updated to reflect version by version upgrade – gozzilli Jun 05 '15 at 12:12
  • Actually there was an interesting thread regarding the LTS upgrade path lately on the group: https://groups.google.com/forum/#!topic/django-developers/qCjfOu-FPxQ – sthzg Jun 05 '15 at 12:13
  • 1
    You should never have to put that code in your models.py. There might be an error in your settings that causes the app registry to not be initialized. Can you open a plain python shell with `DJANGO_SETTINGS_MODULE='path.to.settings'` and see if accessing any settings (specifically `INSTALLED_APPS`) raises any errors? – knbk Jun 05 '15 at 12:24
  • It doesn't seem to raise any errors. Where does that code go then? It comes straight from the release notes. – gozzilli Jun 05 '15 at 13:17
  • Ok, inserting those two lines just before the ``INSTALLED_APPS`` definition in settings.py solves the problem, though I'm not sure it's the right thing to do. – gozzilli Jun 05 '15 at 13:20
  • in case anyone with this problem gets here without having solved this already, this problem was answered here: http://stackoverflow.com/questions/25537905/django-1-7-throws-django-core-exceptions-appregistrynotready-models-arent-load – matias elgart Apr 21 '17 at 20:10

0 Answers0