revsys / django-health-check

a pluggable app that runs a full check on the deployment, using a number of plugins to check e.g. database, queue server, celery processes, etc.
https://readthedocs.org/projects/django-health-check/
MIT License
1.23k stars 191 forks source link

Getting exception #158

Closed neerajprasad closed 6 years ago

neerajprasad commented 6 years ago

Hi, I am implementing health check for my project and it work absolute fine until when i try to enable cache in my project.

I tried all possible way from my side but couldn't able to figure out.

Please help .

Urls :

urlpatterns = patterns(
url(r'^api/health/$', include('health_check.urls'))
)

Settings: config

INSTALLED_APPS =[
'health_check',  # required
    'health_check.db',  # stock Django health checkers
    'health_check.contrib.rmq',
    'health_check.cache'
]
HEALTH_CHECK_CONF = dict(rmq_host=BROKER_URL, sqs_queue_name='queue_name', region_name='eu-west-1',
                         aws_secret_access_key='mykey', aws_access_key_id='access_id',
                         soft_dependencies=[CACHES]
                         )

===========

 Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/neeraj/virtualenv/python2/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/Users/neeraj/virtualenv/python2/lib/python2.7/site-packages/django/core/management/__init__.py", line 312, in execute
    django.setup()
  File "/Users/neeraj/virtualenv/python2/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/neeraj/virtualenv/python2/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/Users/neeraj/virtualenv/python2/lib/python2.7/site-packages/django/apps/config.py", line 119, in create
    import_module(entry)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named cacherest_framework

==========

Regards, Neeraj

codingjoe commented 6 years ago

Hi @neerajprasad you are missing a comma in you INSTALLED_APP setting right after 'health_check.cache'. I presume the next app in the list is rest_framework. Without the comma the strings will be appended and Django will try to import health_check. cacherest_framework which of course doesn't exist ;)