How to Solve Error Message ImportError: Your WhiteNoise configuration is incompatible with WhiteNoise v4.0 when executing python collectstatic

Posted on

This article is actually a continuation from the previous article. It is an event where the solution in the previous article with the title of ‘How to Solve error Message ModuleNotFoundError : No module named ‘whitenoise’ when executing python collectstatic’ in this link.  The problem continue by displaying a different type of error. The error itself exist in the title of the article. The main cause is the definition of the following line configuration in the ‘’ file in a Django-based framework web application :

STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'

Below is the full output error message describing it :

(env) user@hostname:~/python/django/todoproject$ python collectstatic
Traceback (most recent call last):
  File "", line 21, in 
  File "", line 17, in main
  File "/home/user/python/django/env/lib/python3.7/site-packages/django/core/management/", line 381, in execute_from_command_line
  File "/home/user/python/django/env/lib/python3.7/site-packages/django/core/management/", line 375, in execute
  File "/home/user/python/django/env/lib/python3.7/site-packages/django/core/management/", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/user/python/django/env/lib/python3.7/site-packages/django/core/management/", line 364, in execute
    output = self.handle(*args, **options)
  File "/home/user/python/django/env/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/", line 162, in handle
    if self.is_local_storage() and
  File "/home/user/python/django/env/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/", line 216, in is_local_storage
    return isinstance(, FileSystemStorage)
  File "/home/user/python/django/env/lib/python3.7/site-packages/django/utils/", line 256, in inner
  File "/home/user/python/django/env/lib/python3.7/site-packages/django/contrib/staticfiles/", line 498, in _setup
    self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)()
  File "/home/user/python/django/env/lib/python3.7/site-packages/django/core/files/", line 358, in get_storage_class
    return import_string(import_path or settings.DEFAULT_FILE_STORAGE)
  File "/home/user/python/django/env/lib/python3.7/site-packages/django/utils/", line 17, in import_string
    module = import_module(module_path)
  File "/home/user/python/django/env/lib/python3.7/importlib/", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1006, in _gcd_import
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in _call_with_frames_removed
  File "/home/user/python/django/env/lib/python3.7/site-packages/whitenoise/", line 2, in 

Your WhiteNoise configuration is incompatible with WhiteNoise v4.0
This can be fixed by following the upgrade instructions at:

So, the following is the solution taken to solve the above problem or error message :

1. According to the link above, the following step is just to install the different version of the module or to upgrade it according to information on the link. The following is the execution of the process :

(env) user@hostname:~/python/django/todoproject$ pip install whitenoise[brotli]
Requirement already satisfied: whitenoise[brotli] in /home/user/python/django/env/lib/python3.7/site-packages (5.0.1)
Collecting Brotli; extra == "brotli"
  Downloading Brotli-1.0.7-cp37-cp37m-manylinux1_x86_64.whl (352 kB)
     |████████████████████████████████| 352 kB 248 kB/s 
Installing collected packages: Brotli
Successfully installed Brotli-1.0.7
(env) user@hostname:~/python/django/todoproject$ 

2. Unfortunately, the solution is not a success. The above alternative solution step is still not working.

Finally, the solution is just remove the definition of the above configuration in the ‘’ file. Just remove the following line configuration or give a remark or comment sign in the ‘’ file :

# STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'


Continue on the process, collecting static files can still be a success without the above line configuration. The following is the actual execution after removing or commenting the above line configuration :

(env) user@hostname:~/python/django/todoproject$ python collectstatic

119 static files copied to '/home/user/python/django/todoproject/todoproject/static'.
(env) user@hostname:~/python/django/todoproject$ python runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
March 15, 2020 - 09:07:23
Django version 2.2.6, using settings 'todoproject.settings'
Starting development server at
Quit the server with CONTROL-C.

Leave a Reply