Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Python by (120 points)

This is my error. im running my django app on virtual environment server is running if i run the url in browser it showing this error also ("A server error occurred. Please contact the administrator")

(code_review) C:\code_review\code_review\comcast-nso-df-kt>python manage.py runserver

Watching for file changes with StatReloader

Performing system checks...

System check identified no issues (0 silenced).

February 19, 2020 - 17:13:11

Django version 3.0.3, using settings 'mysite.settings'

Starting development server at http://127.0.0.1:8000/

Quit the server with CTRL-BREAK.

Traceback (most recent call last):

  File "c:\users\mpriya\appdata\local\programs\python\python37-32\Lib\wsgiref\handlers.py", line 137, in run

    self.result = application(self.environ, self.start_response)

  File "C:\code_review\lib\site-packages\django\contrib\staticfiles\handlers.py", line 68, in __call__

    return self.application(environ, start_response)

TypeError: 'NoneType' object is not callable

[19/Feb/2020 17:14:05] "GET /login HTTP/1.1" 500 59

Traceback (most recent call last):

  File "c:\users\mpriya\appdata\local\programs\python\python37-32\Lib\wsgiref\handlers.py", line 137, in run

    self.result = application(self.environ, self.start_response)

  File "C:\code_review\lib\site-packages\django\contrib\staticfiles\handlers.py", line 68, in __call__

    return self.application(environ, start_response)

TypeError: 'NoneType' object is not callable

[19/Feb/2020 17:14:07] "GET /favicon.ico HTTP/1.1" 500 59

This is my code

class StaticFilesHandler(StaticFilesHandlerMixin, WSGIHandler):

    """

    WSGI middleware that intercepts calls to the static files directory, as

    defined by the STATIC_URL setting, and serves those files.

    """

    def __init__(self, application):

        self.application = application

        self.base_url = urlparse(self.get_base_url())

        super().__init__()

    def __call__(self, environ, start_response):

        if not self._should_handle(get_path_info(environ)):

            return self.application(environ, start_response)

        return super().__call__(environ, start_response)

Please log in or register to answer this question.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.7k questions

32.8k answers

500 comments

109k users

Browse Categories

...