推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
oahebky
V2EX  ›  Python

有点儿困惑: scrapy-redis 使用不同的 db,哪种方式更好?

  •  
  •   oahebky · Apr 30, 2020 · 2289 views
    This topic created in 2226 days ago, the information mentioned may be changed or developed.

    方式一: 直接在 REDIS_PARAMS 中配置 db,如:

    # scrapy project - settings.py
    
    REDIS_HOST = "localhost"
    REDIS_PARAMS = {"db": 7}
    

    方式二: 使用 REDIS_DB (注:需要更新 scrapy-redis 源码),如:

    # scrapy project - settings.py
    
    REDIS_HOST = "localhost"
    REDIS_DB = 7
    


    注:方式二需要修改的 scrapy-redis 源码如下:

    pull request #166

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3118 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 13:43 · PVG 21:43 · LAX 06:43 · JFK 09:43
    ♥ Do have faith in what you're doing.