Cohen
Cohen

Reputation: 984

Django Error TypeError: 'NoneType' object is not callable

I got this error on the server. Do you know why this happened? I have a django website and have no clue why this error appear in the terminal. Your input would be much valuable!

[19/Mar/2018 18:27:45] "GET /posts/%20/static/css/navbar-top.css HTTP/1.1" 404 107
Traceback (most recent call last):
  File "/usr/lib/python3.4/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/local/lib/python3.4/dist-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
    return super().__call__(environ, start_response)
  File "/usr/local/lib/python3.4/dist-packages/django/core/handlers/wsgi.py", line 146, in __call__
    response = self.get_response(request)
  File "/usr/local/lib/python3.4/dist-packages/django/contrib/staticfiles/handlers.py", line 62, in get_response
    return super().get_response(request)
  File "/usr/local/lib/python3.4/dist-packages/django/core/handlers/base.py", line 81, in get_response
    response = self._middleware_chain(request)
TypeError: 'NoneType' object is not callable

Upvotes: 0

Views: 2033

Answers (1)

A. Rose
A. Rose

Reputation: 468

As mentioned in the comments, code would help people suggest solutions.

In general, when i see a 'Nonetype' not callable, I've usually treated a data member as a function, ie

request.method() 

when it should be something like

request.method

or vice-versa.

Other answers can be found here on stackoverflow:

TypeError: NoneType object is not callable

Upvotes: 1

Related Questions