Skip to content

Instantly share code, notes, and snippets.

@samliu
Created June 22, 2012 23:11
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save samliu/2975718 to your computer and use it in GitHub Desktop.
Save samliu/2975718 to your computer and use it in GitHub Desktop.
manage command for django to call scrapy
# Enable us to call scrapy from manage.py
from __future__ import absolute_import
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def run_from_argv(self, argv):
self._argv = argv
self.execute()
def handle(self, *args, **options):
from scrapy.cmdline import execute
execute(self._argv[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment