-
Notifications
You must be signed in to change notification settings - Fork 90
AppRegistryNotReady error with parsemail.py #15
Copy link
Copy link
Closed
Labels
Description
Using Django 1.9.1
When piping a mail to the parsemail.sh I get the following error.
Looks like it can be fixed by placing "django.setup()" immediately after "import django" instead of at the beginning of main()
Traceback (most recent call last):
File "/home/yuho/git/patchwork/patchwork/bin/parsemail.py", line 38, in <module>
from django.contrib.auth.models import User
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/models.py", line 4, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/base_user.py", line 49, in <module>
class AbstractBaseUser(models.Model):
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 94, in __new__
app_config = apps.get_containing_app_config(module)
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 239, in get_containing_app_config
self.check_apps_ready()
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 124, in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
Reactions are currently unavailable