Skip to content

Instantly share code, notes, and snippets.

@rlander
Forked from samliu/scrapy.py
Created July 14, 2012 02:04
Show Gist options
  • Save rlander/3108799 to your computer and use it in GitHub Desktop.
Save rlander/3108799 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