import os
from django.core.management.base import BaseCommand


class Command(BaseCommand):

    def handle(self, *args, **options):
        os.environ['SCRAPY_SETTINGS_MODULE'] = args[0]
from scrapy.cmdline import execute
execute(list(args))
Django custom management command running Scrapy: How to include Scrapy's options?