[pyar] django_cron

Javier Marcon javiermarcon en gmail.com
Mie Ago 17 09:47:48 ART 2016


El 17/08/16 a las 08:58, Francisco Roldan escribió:
> Hola Javier, creo que te está faltando agregar a la app django_cron el
> archivo apps.py como tenés en la app tor_monitoring.Saludos
Gracias, pero agregue el apps.py con:

from __future__ import unicode_literals
from django.apps import AppConfig
class DjangoCronConfig(AppConfig):
    name = 'django_cron'

Pero me seguía tirando el traceback, entonces cambié el 'django_cron'
por 'django_cron.apps.DjangoCronConfig' en installed_apps, pero me sigue
tirando el traceback:

python manage.py makemigrations
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 367, in execute_from_command_line
    utility.execute()
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 341, in execute
    django.setup()
  File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line
27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py",
line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py",
line 90, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File
"/media/old_root/javier/securework/src/mmonitor/mmonitor/django_cron/__init__.py",
line 23, in <module>
    from base import Job, cronScheduler
  File
"/media/old_root/javier/securework/src/mmonitor/mmonitor/django_cron/base.py",
line 31, in <module>
    import models
  File
"/media/old_root/javier/securework/src/mmonitor/mmonitor/django_cron/models.py",
line 26, in <module>
    class Job(models.Model):
  File
"/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line
105, in __new__
    app_config = apps.get_containing_app_config(module)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py",
line 237, 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.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

Aparentemente el problema está cuando quiere cargar la clase Job del
modelo (de django_cron), pero no encuentro por que no la puede cargar.

Gracias,

Javier.


Más información sobre la lista de distribución pyar