logging error Permission Error [WinError 32]

created at 01-08-2022 views: 9


Django fails to operate file when using logging logging module logging error Permission Error [WinError 32].


This problem will only be encountered during development, and the configuration is written to the setting.py configuration file. We define the log file size. When the log is full, this problem will be encountered at this time, because in the When running django with Pycharm, we enable both processes to initialize the setting.py configuration:

  • One is our normal visit,
  • One is to monitor code changes

You will find that every time you modify some code, django will rebuild itself, which is completed by this process), because they all hold the handle of the file, so it fails when archiving


method 1:

Add the --noreload parameter when starting django, like

python manage.py runserver --noreload

After adding the --noreload parameter, when the development server is started, if the python code of the django project is modified, the server will not restart automatically

Method 2:

Expand the log file

Modify the log configuration information in setting.py to expand maxBytes

created at:01-08-2022
edited at: 01-08-2022: