I just upgraded to Django 1.7c1 and django-twilio 0.5.2, and I get the following error when I try to runserver or migrate: django.core.exceptions.AppRegistryNotReady.
The source of the problem is 'get_user_model' on line 12 of compat.py, which is invoked by the AUTH_USER_MODEL import on line 6 of models.py. Here's an explanation of the issue from the Django documentation:
Generally speaking, you should reference the User model with the AUTH_USER_MODEL setting in code that is executed at import time. get_user_model() only works once Django has imported all models.
https://docs.djangoproject.com/en/dev/topics/auth/customizing/#django.contrib.auth.get_user_model
I believe the problem can be resolved by declaring the AUTH_USER_MODEL in models.py instead of importing from compat.py. However, I'm not sure why lines 9-16 of compat.py are necessary in the first place.
The full traceback is below:
Traceback (most recent call last):
File "./manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/Users/michaelgodshall/.virtualenvs/social-tool/lib/python2.7/site-packages/django/core/management/init.py", line 385, in execute_from_command_line
utility.execute()
File "/Users/michaelgodshall/.virtualenvs/social-tool/lib/python2.7/site-packages/django/core/management/init.py", line 354, in execute
django.setup()
File "/Users/michaelgodshall/.virtualenvs/social-tool/lib/python2.7/site-packages/django/init.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/michaelgodshall/.virtualenvs/social-tool/lib/python2.7/site-packages/django/apps/registry.py", line 106, in populate
app_config.import_models(all_models)
File "/Users/michaelgodshall/.virtualenvs/social-tool/lib/python2.7/site-packages/django/apps/config.py", line 190, in import_models
self.models_module = import_module(models_module_name)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/Users/michaelgodshall/.virtualenvs/social-tool/lib/python2.7/site-packages/django_twilio/models.py", line 8, in
from django_twilio.compat import AUTH_USER_MODEL
File "/Users/michaelgodshall/.virtualenvs/social-tool/lib/python2.7/site-packages/django_twilio/compat.py", line 12, in
User = get_user_model()
File "/Users/michaelgodshall/.virtualenvs/social-tool/lib/python2.7/site-packages/django/contrib/auth/init.py", line 136, in get_user_model
return django_apps.get_model(settings.AUTH_USER_MODEL)
File "/Users/michaelgodshall/.virtualenvs/social-tool/lib/python2.7/site-packages/django/apps/registry.py", line 187, in get_model
self.check_ready()
File "/Users/michaelgodshall/.virtualenvs/social-tool/lib/python2.7/site-packages/django/apps/registry.py", line 119, in check_ready
raise AppRegistryNotReady()
django.core.exceptions.AppRegistryNotReady