Using Django views when importing a external module with multiprocessing
问题 I built a scraping module "scraper.py" that also has the ability to download file and I imported this module into django views. Issue is that in the scraper.py, this " __name__='__main__ " is included where the multiprocessing pool is, so when I import the module and try to run it, it doesn't work because it isn't the main . This is the script(scraper.py) that uses the pool method. def download(self, url): response = self._is_downloadable(url) if response: name = response.headers.get('content