Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

195
Visualizações
Apache2&Django - NameError: name "AttributeError" is not defined

I followed pretty much every official documentation to get my Django project running on my Ubuntu 18.04 v-server. And it seems to work...sudo service apache2 status -> everything ok too.

[Sun May 03 16:07:20.489608 2020] [mpm_event:notice] [pid 11531:tid 139884218760128] AH00489: 
Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 mod_wsgi/4.7.1 Python/3.8 configured -- resuming normal operations

[Sun May 03 16:07:20.489764 2020] [core:notice] [pid 11531:tid 139884218760128] AH00094:
Command line: '/usr/sbin/apache2'

I first noticed that something's off when my templates wouldn't update without a server restart which is not Django's usual behaviour (even in a productive environment). Whenever I restart the server I get this error in the apache2/error.log. Although the server keeps working I want to get to the bottom of this.

Exception ignored in: <function Local.__del__ at 0x7fbd983f03a0>
Traceback (most recent call last):
  File "/var/www/my_app/.my_app/lib/python3.8/site-packages/asgiref/local.py", line 95, in __del__
NameError: name 'AttributeError' is not defined
Exception ignored in: <function Local.__del__ at 0x7fbd983f03a0>
Traceback (most recent call last):
  File "/var/www/my_app/.my_app/lib/python3.8/site-packages/asgiref/local.py", line 95, in __del__
NameError: name 'AttributeError' is not defined
[Sun May 03 16:07:19.418926 2020] [core:warn] [pid 11433:tid 140452536064960] AH00045: child process 11435 still did not exit, sending a SIGTERM
[Sun May 03 16:07:20.419208 2020] [mpm_event:notice] [pid 11433:tid 140452536064960] AH00491: caught SIGTERM, shutting down
[Sun May 03 16:07:20.489608 2020] [mpm_event:notice] [pid 11531:tid 139884218760128] AH00489: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 mod_wsgi/4.7.1 Python/3.8 configured -- resuming normal operations
[Sun May 03 16:07:20.489764 2020] [core:notice] [pid 11531:tid 139884218760128] AH00094: Command line: '/usr/sbin/apache2'
  • Ubuntu 18.04
  • Python3.8.0 and linked to the python-command via update-alternatives
  • Python running in venv

Project-structure:

in /var/www/:
    |-- my_app
    |   |-- my_app
    |   |   |-- __init__.py
    |   |   |-- asgi.py
    |   |   |-- settings.py
    |   |   |-- urls.py
    |   |   `-- wsgi.py
    |   |-- db.sqlite3
    |   |-- manage.py
    |   |-- media
    |   |-- .my_app (python venv)
    |   |-- my_subapp
    |   |   |-- __init__.py
    |   |   |-- admin.py
    |   |   |-- apps.py
    |   |   |-- migrations
    |   |   |-- models.py
    |   |   |-- tests.py
    |   |   |-- urls.py
    |   |   `-- views.py
    |   `-- templates
    |       |-- base.html
    |       `-- index.html

Any suggestions what could be wrong and why it says "AttributeError not found?" when it seems to be a standard python class that ship with it out of the box... Thank you for your help :-)

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

It took me a day to find out what the issue was - Thanks to Graham Dumpleton - the creator of the mod_wsgi for explaining everything. You can look it up here:

https://github.com/GrahamDumpleton/mod_wsgi/issues/568

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda