Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Change TWISTED_REACTOR in the default template.

Andrey Rakhmatullin62cc26e209b6
diff --git a/docs/topics/settings.rst b/docs/topics/settings.rst
index a711fd197..0b1ef71cf 100644
--- a/docs/topics/settings.rst
+++ b/docs/topics/settings.rst
@@ -1642,6 +1642,11 @@ install the default reactor defined by Twisted for the current platform. This
is to maintain backward compatibility and avoid possible problems caused by
using a non-default reactor.
+.. versionchanged:: VERSION
+ The :command:`startproject` command now sets this setting to
+ ``twisted.internet.asyncioreactor.AsyncioSelectorReactor`` in the generated
+ ``settings.py`` file.
+
For additional information, see :doc:`core/howto/choosing-reactor`.
diff --git a/scrapy/templates/project/module/settings.py.tmpl b/scrapy/templates/project/module/settings.py.tmpl
index 5e541e2c0..c0c34e986 100644
--- a/scrapy/templates/project/module/settings.py.tmpl
+++ b/scrapy/templates/project/module/settings.py.tmpl
@@ -89,3 +89,4 @@ ROBOTSTXT_OBEY = True
# Set settings whose default value is deprecated to a future-proof value
REQUEST_FINGERPRINTER_IMPLEMENTATION = 'VERSION'
+TWISTED_REACTOR = 'twisted.internet.asyncioreactor.AsyncioSelectorReactor'