Access django models inside of Scrapy

后端 未结 8 2245
执笔经年
执笔经年 2020-11-28 19:11

Is it possible to access my django models inside of a Scrapy pipeline, so that I can save my scraped data straight to my model?

I\'ve seen this, but I don\'t really

8条回答
  •  粉色の甜心
    2020-11-28 19:46

    Why not create a __init__.py file in the scrapy project folder and hook it up in INSTALLED_APPS? Worked for me. I was able to simply use:

    piplines.py

    from my_app.models import MyModel
    

    Hope that helps.

提交回复
热议问题