Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8194795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:56:18+00:00 2026-06-07T04:56:18+00:00

I am attempting to set up a custom downloader middleware class in Scrapy. I

  • 0

I am attempting to set up a custom downloader middleware class in Scrapy. I suspect that I’ve missed something obvious, but I’ve read over the docs a few times and have found no solutions. I’m getting a bit frustrated with what should be an extremely simple task, so hopefully someone will be able to provide me with some insight.

I’ve added the following line to my settings.py file.

DOWNLOADER_MIDDLEWARES = { 'myproject.middlewares.TestDownloader': 400 }

After adding that line and running the project, I got an error about the module middlewares not existing. After some research, I discovered that you needed to add a __init__.py file to the middlewares folder for Python to recognize it. I did this, and am now getting the following error:

NameError: Module 'myproject.middlewares' doesn't define any object named 'TestDownloader'

The TestDownloader.py file is not being compiled, while all other *.py files in the project are. If I understand my Python reading correctly, that means it isn’t being imported anywhere, but I can’t find any additional Scrapy settings to change to make this work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:56:18+00:00Added an answer on June 7, 2026 at 4:56 am
    DOWNLOADER_MIDDLEWARES = { 'myproject.middlewares.TestDownloader': 400 }
    

    For this to work, create file middlewares.py inside myproject folder, and in that file put your downloader middleware class called TestDownloader.

    Or having middlewares folder with __init__.py inside it, you can put put your downloader middleware class called TestDownloader inside __init__.py — this should work too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to create a set of folders that comes in from a
Setup: I have a custom class I've created that handles data retrieved from a
I'm attempting to add a custom dialog box to my current GUI that can
I am attempting to write a custom membership class. It seems to work ok
I have a custom web part I've built, that I'm attempting to place three
I've set up a custom action and custom object. I'm attempting to post to
I'm attempting to construct a Django application that models an existing set of tables.
I've been attempting to modify the contents of a custom tree view that inherits
Attempting to set up an automated texting service for customers, where people can text
I'm attempting to set up Pinned Site features for my project. The trouble is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.