Question: I want to [run scrapy from a single script](http://doc.scrapy.org/en/latest/topics/practices.html#run-scrapy-from-a-script) and I want to get all settings from settings.py but I would like to be able to change some of them:

```
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings

process = CrawlerProcess(get_project_settings())

*### so what im missing here is being able to set or override one or two of the settings###*

# 'followall' is the name of one of the spiders of the project.
process.crawl('testspider', domain='scrapinghub.com')
process.start() # the script will block here until the crawling is finished

```

I wasn't able to use [this](http://doc.scrapy.org/en/latest/topics/api.html#scrapy.settings.Settings). I tried the following:

```
settings=scrapy.settings.Settings()
settings.set('RETRY_TIMES',10)

```

but it didn't work.

Note: I'm using the latest version of scrapy.

Answer: 
So in order to override some settings, one way would be overriding/setting custom\_settings, the spider's static variable, in our script. 

so I imported the spider's class and then override the custom\_setting:

```
from testspiders.spiders.followall import FollowAllSpider 

FollowAllSpider.custom_settings={'RETRY_TIMES':10}

```

So this is the whole script:

```
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from testspiders.spiders.followall import FollowAllSpider 

FollowAllSpider.custom_settings={'RETRY_TIMES':10}
process = CrawlerProcess(get_project_settings())

# 'followall' is the name of one of the spiders of the project.
process.crawl('testspider', domain='scrapinghub.com')
process.start() # the script will block here until the crawling is finished

```
For some reason, the above script didn't work for me. Instead I wrote the following and it works. Posting in case if anyone else falls into the same issue.

```
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings

process = CrawlerProcess(get_project_settings())
process.settings.set(
            'RETRY_TIMES', 10, priority='cmdline')

process.crawl('testspider', domain='scrapinghub.com')
process.start()

```