NameError: name 'hasattr' is not defined - Python3.6, Django1.11, Ubuntu16-17, Apache2.4, mod_wsgi

前端 未结 3 1390
猫巷女王i
猫巷女王i 2021-01-12 10:54

I\'ve set up my Python/Django virtual environment, and mod_wsgi in daemon mode, and am pretty sure (done this before) it\'s \"mostly correct\" except I get the fol

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-12 11:09

    I encountered the same problem as well.

    [Wed Sep 12 16:30:19 2018] [notice] Apache/2.2.15 (Unix) DAV/2 mod_wsgi/4.6.4     
    Python/3.6 configured -- resuming normal operations
    Exception ignored in: 
    Traceback (most recent call last):
      File "/mnt/workshop/py36env/lib/python3.6/site-packages/PIL/Image.py", line 600, in __del__
    NameError: name 'hasattr' is not defined
    Exception ignored in: 
    Traceback (most recent call last):
      File "/mnt/workshop/py36env/lib/python3.6/site-packages/PIL/Image.py", line 600, in __del__
    NameError: name 'hasattr' is not defined
    Exception ignored in: 
    Traceback (most recent call last):
      File "/mnt/workshop/py36env/lib/python3.6/site-packages/PIL/Image.py", line 600, in __del__
    NameError: name 'hasattr' is not defined
    Exception ignored in: 
    Traceback (most recent call last):
      File "/mnt/workshop/py36env/lib/python3.6/site-packages/PIL/Image.py", line 600, in __del__
    NameError: name 'hasattr' is not defined
    Exception ignored in: 
    Traceback (most recent call last):
      File "/mnt/workshop/py36env/lib/python3.6/site-packages/PIL/Image.py", line 600, in __del__
    NameError: name 'hasattr' is not defined
    [Wed Sep 12 16:33:57 2018] [notice] caught SIGTERM, shutting down
    [Wed Sep 12 16:33:58 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
    
    
    

    It maybe happened when you made a new dir but never authorized.

    And I fixed it by the following:

    chmod -R 755 /mnt/workshop/your_project_path
    chown -R apache:apache /mnt/workshop/your_project_path
    

    提交回复
    热议问题