Re: [Graphite-dev] [Question #665543]: AppRegistryNotReady: Apps aren't loaded yet.

2018-03-13 Thread Alex Njaastad
Question #665543 on Graphite changed:
https://answers.launchpad.net/graphite/+question/665543

Status: Open => Solved

Alex Njaastad confirmed that the question is solved:
At the time I posted the question I greatly misunderstood how Graphite
was actually being run in a configuration I inherited. I reviewed
https://graphite.readthedocs.io/en/latest/config-webapp.html and was
able to solve my problems fairly quickly.

-- 
You received this question notification because your team graphite-dev
is an answer contact for Graphite.

___
Mailing list: https://launchpad.net/~graphite-dev
Post to : graphite-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~graphite-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Graphite-dev] [Question #665543]: AppRegistryNotReady: Apps aren't loaded yet.

2018-03-13 Thread Denis Zhdanov
Question #665543 on Graphite changed:
https://answers.launchpad.net/graphite/+question/665543

Denis Zhdanov posted a new comment:
Hi Alex,

Sorry, it's not really clear what's your issue is, could you please elaborate?
If unmodified manage.py works and modified is not - then do not use modified. 
or I'm missing something?

-- 
You received this question notification because your team graphite-dev
is an answer contact for Graphite.

___
Mailing list: https://launchpad.net/~graphite-dev
Post to : graphite-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~graphite-dev
More help   : https://help.launchpad.net/ListHelp


[Graphite-dev] [Question #665543]: AppRegistryNotReady: Apps aren't loaded yet.

2018-03-13 Thread Alex Njaastad
New question #665543 on Graphite:
https://answers.launchpad.net/graphite/+question/665543

I'm attempting to run graphite-web 1.1.2 using Python 2.7 and Django 1.11.11.

I am attempting to start the server using a slightly modified manage.py script 
(I added the django.setup() following suggestions found online):

```
#!/usr/bin/env python
import os
import sys
import django


if __name__ == "__main__":


os.environ.setdefault("DJANGO_SETTINGS_MODULE", "graphite.settings")

django.setup()

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)
```

I am executing this script like this:

`python manage.py migrate --noinput`

The script appears to execute fine, but when I try to access graphite-web this 
error is produced:

```
[Tue Mar 13 09:47:22.702806 2018] [wsgi:error] [pid 8034:tid 140283148187520] 
mod_wsgi (pid=8034): Target WSGI script 
'/var/vcap/packages/graphite-web/conf/graphite.wsgi' cannot be loaded as Python 
module.
[Tue Mar 13 09:47:22.702837 2018] [wsgi:error] [pid 8034:tid 140283148187520] 
mod_wsgi (pid=8034): Exception occurred processing WSGI script 
'/var/vcap/packages/graphite-web/conf/graphite.wsgi'.
[Tue Mar 13 09:47:22.702864 2018] [wsgi:error] [pid 8034:tid 140283148187520] 
Traceback (most recent call last):
[Tue Mar 13 09:47:22.702884 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
File "/var/vcap/packages/graphite-web/conf/graphite.wsgi", line 7, in 
[Tue Mar 13 09:47:22.702961 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
  application = django.core.handlers.wsgi.WSGIHandler()
[Tue Mar 13 09:47:22.702977 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
File 
"/var/vcap/packages/django/lib/python2.7/site-packages/Django-1.11.11-py2.7.egg/django/core/handlers/wsgi.py",
 line 151, in __init__
[Tue Mar 13 09:47:22.703069 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
  self.load_middleware()
[Tue Mar 13 09:47:22.703086 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
File 
"/var/vcap/packages/django/lib/python2.7/site-packages/Django-1.11.11-py2.7.egg/django/core/handlers/base.py",
 line 80, in load_middleware
[Tue Mar 13 09:47:22.703184 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
  middleware = import_string(middleware_path)
[Tue Mar 13 09:47:22.703201 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
File 
"/var/vcap/packages/django/lib/python2.7/site-packages/Django-1.11.11-py2.7.egg/django/utils/module_loading.py",
 line 20, in import_string
[Tue Mar 13 09:47:22.703279 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
  module = import_module(module_path)
[Tue Mar 13 09:47:22.703296 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
File "/var/vcap/packages/python/lib/python2.7/importlib/__init__.py", line 37, 
in import_module
[Tue Mar 13 09:47:22.703346 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
  __import__(name)
[Tue Mar 13 09:47:22.703360 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
File 
"/var/vcap/packages/django/lib/python2.7/site-packages/Django-1.11.11-py2.7.egg/django/contrib/auth/middleware.py",
 line 4, in 
[Tue Mar 13 09:47:22.703435 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
  from django.contrib.auth.backends import RemoteUserBackend
[Tue Mar 13 09:47:22.703450 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
File 
"/var/vcap/packages/django/lib/python2.7/site-packages/Django-1.11.11-py2.7.egg/django/contrib/auth/backends.py",
 line 4, in 
[Tue Mar 13 09:47:22.703526 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
  from django.contrib.auth.models import Permission
[Tue Mar 13 09:47:22.703540 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
File 
"/var/vcap/packages/django/lib/python2.7/site-packages/Django-1.11.11-py2.7.egg/django/contrib/auth/models.py",
 line 4, in 
[Tue Mar 13 09:47:22.703657 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
  from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
[Tue Mar 13 09:47:22.703672 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
File 
"/var/vcap/packages/django/lib/python2.7/site-packages/Django-1.11.11-py2.7.egg/django/contrib/auth/base_user.py",
 line 52, in 
[Tue Mar 13 09:47:22.703749 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
  class AbstractBaseUser(models.Model):
[Tue Mar 13 09:47:22.703766 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
File 
"/var/vcap/packages/django/lib/python2.7/site-packages/Django-1.11.11-py2.7.egg/django/db/models/base.py",
 line 110, in __new__
[Tue Mar 13 09:47:22.704108 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
  app_config = apps.get_containing_app_config(module)
[Tue Mar 13 09:47:22.704125 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
File 
"/var/vcap/packages/django/lib/python2.7/site-packages/Django-1.11.11-py2.7.egg/django/apps/registry.py",
 line 247, in get_containing_app_config
[Tue Mar 13 09:47:22.704251 2018] [wsgi:error] [pid 8034:tid 140283148187520]   
  self.check_