Integrating Scrapy with Django 1.9 : django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet -


i trying use scrapy along django 1.9. both django project 'jobengine' , scrapy project 'computer_jobs_nepal' within same directory. have set scrapy settings.py file locate django models. think importing django models in items.py file working well. run spider :

 scrapy crawl jobsdetail 

it raises following error:

       file "......../django1/computer_jobs_nepal/computer_jobs_nepal/spiders/job_detail_spider.py", line 5, in <module>         computer_jobs_nepal.items import computerjobsnepalitem         file "........../django1/computer_jobs_nepal/computer_jobs_nepal/items.py", line 18, in <module>         apps.jobmanager.models import job         file "........./django1/jobengine/jobengine/apps/jobmanager/models.py", line 18, in <module>         class job(models.model):         file "......../envdjango/local/lib/python2.7/site-packages/django/db/models/base.py", line 94, in __new__         app_config = apps.get_containing_app_config(module)         file "........./envdjango/local/lib/python2.7/site-packages/django/apps/registry.py", line 239, in get_containing_app_config         self.check_apps_ready()         file "........./envdjango/local/lib/python2.7/site-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. 

you need have following inside scrapy settings.py file have django integrated.

import sys ...  sys.path.append('/path/to/your/django_project') django.core.wsgi import get_wsgi_application application = get_wsgi_application() 

Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -