Re: Query on AppRegistryNotReady: Apps aren't loaded yet error

48 views
Skip to first unread message

Nilesh

unread,
Jan 4, 2017, 6:27:13 AM1/4/17
to pritesh modi, django...@googlegroups.com
Really, I did not face this issue in past.

It may be some setup issue. Some app is not registered properly. Check admin.py or settings.py 

On Wed, Jan 4, 2017 at 3:18 PM, pritesh modi <pritesh...@gmail.com> wrote:
Team


In VM Django with 1.6 run below code and generate a HTMLreport template , then use the intcoma filter support by 'django.contrib.humanize' like


<td class="inright">{{Contigs_|intcomma}}</td></tr>


Actual code


PATH = os.path.dirname(os.path.abspath(__file__))

  printlog("PATH****************%s"%PATH)

  if not settings.configured:

    plugin_dir = pluginParams['plugin_dir'] if 'plugin_dir' in pluginParams else os.path.realpath(__file__)

    settings.configure( DEBUG=False, TEMPLATE_DEBUG=False,

      INSTALLED_APPS=('django.contrib.humanize'),

      TEMPLATE_DIRS=(os.path.join(PATH,'templates'),) )

  with open(reportName,'w') as bcsum:

    bcsum.write( render_to_string(reportTemplate,safeKeys(reportData)) )

 

 

 


But now when I am trying to run same code in Django 1.8 giving following error

 

Traceback (most recent call last):

  File "coverageAnalysisReport.py", line 438, in createReport

    bcsum.write( render_to_string(reportTemplate,safeKeys(reportData)) )

  File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 98, in render_to_string

    template = get_template(template_name, using=using)

  File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 35, in get_template

    return engine.get_template(template_name, dirs)

  File "/usr/local/lib/python2.7/dist-packages/django/template/backends/django.py", line 30, in get_template

    return Template(self.engine.get_template(template_name, dirs))

  File "/usr/local/lib/python2.7/dist-packages/django/template/engine.py", line 167, in get_template

    template, origin = self.find_template(template_name, dirs)

  File "/usr/local/lib/python2.7/dist-packages/django/template/engine.py", line 141, in find_template

    source, display_name = loader(name, dirs)

  File "/usr/local/lib/python2.7/dist-packages/django/template/loaders/base.py", line 13, in __call__

    return self.load_template(template_name, template_dirs)

  File "/usr/local/lib/python2.7/dist-packages/django/template/loaders/base.py", line 17, in load_template

    template_name, template_dirs)

  File "/usr/local/lib/python2.7/dist-packages/django/template/loaders/app_directories.py", line 36, in load_template_source

    for filepath in self.get_template_sources(template_name, template_dirs):

  File "/usr/local/lib/python2.7/dist-packages/django/template/loaders/app_directories.py", line 26, in get_template_sources

    template_dirs = get_app_template_dirs('templates')

  File "/usr/local/lib/python2.7/dist-packages/django/utils/lru_cache.py", line 125, in wrapper

    result = user_function(*args, **kwds)

  File "/usr/local/lib/python2.7/dist-packages/django/template/utils.py", line 120, in get_app_template_dirs

    for app_config in apps.get_app_configs():

  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 137, in get_app_configs

    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.")

AppRegistryNotReady: Apps aren't loaded yet.

 

 

Could you please tell me who could be reason of above issue or any pointers to solve this issue?



 



--
Regards
------------------------------------
Nilesh Gorle
------------------------------------

Reply all
Reply to author
Forward
0 new messages