Algunas veces funciona bien e informa lo siguiente:
{{{
System check identified no issues (0 silenced).
April 11, 2019 - 19:29:25
Django version 2.1.4, using settings 'base.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
}}}
En ocasiones pasa lo siguiente y es muy repetitivo:
{{{
/home/irvin/Documentos/Proyectos/REST-env/base/snippets/views.py changed,
reloading.
Watching for file changes with StatReloader
Performing system checks...
Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/template/utils.py", line 66, in __getitem__
return self._engines[alias]
KeyError: 'django'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/core/management/commands/runserver.py", line 117, in
inner_run
self.check(display_num_errors=True)
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/core/management/base.py", line 390, in check
include_deployment_checks=include_deployment_checks,
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/core/management/base.py", line 377, in _run_checks
return checks.run_checks(**kwargs)
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/core/checks/registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/contrib/admin/checks.py", line 80, in check_dependencies
for engine in engines.all():
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/template/utils.py", line 90, in all
return [self[alias] for alias in self]
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/template/utils.py", line 90, in <listcomp>
return [self[alias] for alias in self]
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/template/utils.py", line 81, in __getitem__
engine = engine_cls(params)
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/template/backends/django.py", line 25, in __init__
options['libraries'] = self.get_templatetag_libraries(libraries)
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/template/backends/django.py", line 43, in
get_templatetag_libraries
libraries = get_installed_libraries()
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/template/backends/django.py", line 108, in
get_installed_libraries
for name in get_package_libraries(pkg):
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/template/backends/django.py", line 121, in
get_package_libraries
module = import_module(entry[1])
File "/home/irvin/Documentos/Proyectos/REST-
env/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in
_find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/rest_framework/templatetags/rest_framework.py", line 15, in
<module>
from rest_framework.renderers import HTMLFormRenderer
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/rest_framework/renderers.py", line 20, in <module>
from django.test.client import encode_multipart
File "/home/irvin/Documentos/Proyectos/REST-env/lib/python3.6/site-
packages/django/test/client.py", line 23, in <module>
from django.test import signals
File "<frozen importlib._bootstrap>", line 968, in _find_and_load
File "<frozen importlib._bootstrap>", line 149, in __enter__
File "<frozen importlib._bootstrap>", line 94, in acquire
_frozen_importlib._DeadlockError: deadlock detected by
_ModuleLock('django.test.signals') at 140476939476608
}}}
SO Ubuntu 18
Componentes instalados:
Python 3.6.7
Django 2.2
django-crispy-forms 1.7.2
django-environ 0.4.5
django-filter 2.1.0
django-smart-selects 1.5.4
django-tables2 2.0.6
django-widget-tweaks 1.4.3
djangorestframework 3.9.2
Markdown 3.1
numpy 1.16.2
pip 19.0.3
pkg-resources 0.0.0
psycopg2-binary 2.8.1
Pygments 2.3.1
pytz 2019.1
setuptools 41.0.0
sqlparse 0.3.0
table 0.0.4
wheel 0.33.1
--
Ticket URL: <https://code.djangoproject.com/ticket/30352>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => worksforme
Comment:
Thanks for the report, however I cannot reproduce this issue. You should
take into account that not all 3rd party packages that you mentioned in a
ticket description support Django 2.2, e.g. `django-environ`.
Please use one of
[https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
support channels].
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:1>
* status: closed => new
* resolution: worksforme =>
Comment:
I'm seeing the same issue apparently (although I don't understand Spanish
well):
{{{
Watching for file changes with StatReloader
Performing system checks...
Exception in thread Thread-1:
Traceback (most recent call last):
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/template/utils.py", line 66, in __getitem__
return self._engines[alias]
KeyError: 'django'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/core/management/commands/runserver.py", line 117, in
inner_run
self.check(display_num_errors=True)
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/core/management/base.py", line 390, in check
include_deployment_checks=include_deployment_checks,
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/core/management/base.py", line 377, in _run_checks
return checks.run_checks(**kwargs)
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/core/checks/registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/contrib/admin/checks.py", line 80, in check_dependencies
for engine in engines.all():
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/template/utils.py", line 90, in all
return [self[alias] for alias in self]
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/template/utils.py", line 90, in <listcomp>
return [self[alias] for alias in self]
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/template/utils.py", line 81, in __getitem__
engine = engine_cls(params)
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/template/backends/django.py", line 25, in __init__
options['libraries'] = self.get_templatetag_libraries(libraries)
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/template/backends/django.py", line 43, in
get_templatetag_libraries
libraries = get_installed_libraries()
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/template/backends/django.py", line 108, in
get_installed_libraries
for name in get_package_libraries(pkg):
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/template/backends/django.py", line 121, in
get_package_libraries
module = import_module(entry[1])
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in
import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in
_find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/rest_framework/templatetags/rest_framework.py", line 15, in
<module>
from rest_framework.renderers import HTMLFormRenderer
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/rest_framework/renderers.py", line 20, in <module>
from django.test.client import encode_multipart
File "<home_dir>/rest_api/env/lib/python3.6/site-
packages/django/test/client.py", line 23, in <module>
from django.test import signals
File "<frozen importlib._bootstrap>", line 968, in _find_and_load
File "<frozen importlib._bootstrap>", line 149, in __enter__
File "<frozen importlib._bootstrap>", line 94, in acquire
_frozen_importlib._DeadlockError: deadlock detected by
_ModuleLock('django.test.signals') at 140466248423072
}}}
My packages list is a bit shorter:
{{{
certifi==2019.3.9
chardet==3.0.4
colorama==0.4.1
Django==2.2
djangorestframework==3.9.2
future==0.17.1
h2o==3.22.1.5
idna==2.8
numpy==1.16.2
pandas==0.24.2
pkg-resources==0.0.0
python-dateutil==2.8.0
pytz==2018.9
requests==2.21.0
six==1.12.0
sqlparse==0.3.0
tabulate==0.8.3
urllib3==1.24.1
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:2>
Comment (by felixxm):
Everything works for me :| Can you provide test project to reproduce this
issue?
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:3>
* status: new => closed
* resolution: => needsinfo
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:4>
* cc: Scott Talbert (added)
Comment:
In my case, it seems that somehow one or more of the '.pyc' files in my
venv had gotten corrupted somehow. I deleted all the '.pyc' files in my
venv and now I can no longer reproduce the problem.
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:5>
* status: closed => new
* resolution: needsinfo =>
Comment:
I got the same issue. I tried to delete all .pyc. However, the problem
still exists.
I'm not sure what the problem is.
OS: OSX
Python: Python 3.7.1
Django==2.2.1
djangorestframework==3.9.4
Pygments==2.4.1
pytz==2019.1
sqlparse==0.3.0
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:6>
* status: new => closed
* resolution: => needsinfo
Comment:
Please [https://docs.djangoproject.com/en/stable/internals/contributing
/triaging-tickets/#closing-tickets follow triaging guidelines with regards
to needsinfo tickets.] To reopen this ticket you should provide a test
project.
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:7>
* cc: alexkiro (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:8>
* cc: Akos Ladanyi (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:9>
* status: closed => new
* resolution: needsinfo =>
Comment:
There is no resolution for this issue yet. The issue is still there and
cannot be easily reproduced.
[INFO] 2019-08-15 09:43:46,548 django.utils.autoreload (autoreload.py:597)
- Watching for file changes with StatReloader
Performing system checks...
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/template/utils.py", line 66, in __getitem__
return self._engines[alias]
KeyError: 'django'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/python/3.6.7/lib/python3.6/threading.py", line 916, in
_bootstrap_inner
self.run()
File "/opt/python/3.6.7/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/core/management/commands/runserver.py", line 117, in
inner_run
self.check(display_num_errors=True)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/core/management/base.py", line 390, in check
include_deployment_checks=include_deployment_checks,
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/core/management/base.py", line 377, in _run_checks
return checks.run_checks(**kwargs)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/core/checks/registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/contrib/admin/checks.py", line 79, in check_dependencies
for engine in engines.all():
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/template/utils.py", line 90, in all
return [self[alias] for alias in self]
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/template/utils.py", line 90, in <listcomp>
return [self[alias] for alias in self]
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/template/utils.py", line 81, in __getitem__
engine = engine_cls(params)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/template/backends/django.py", line 25, in __init__
options['libraries'] = self.get_templatetag_libraries(libraries)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/template/backends/django.py", line 43, in
get_templatetag_libraries
libraries = get_installed_libraries()
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/template/backends/django.py", line 108, in
get_installed_libraries
for name in get_package_libraries(pkg):
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/template/backends/django.py", line 121, in
get_package_libraries
module = import_module(entry[1])
File
"/home/travis/virtualenv/python3.6.7/lib/python3.6/importlib/__init__.py",
line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in
_find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/rest_framework/templatetags/rest_framework.py", line 12, in
<module>
from rest_framework.renderers import HTMLFormRenderer
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/rest_framework/renderers.py", line 19, in <module>
from django.test.client import encode_multipart
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-
packages/django/test/client.py", line 23, in <module>
from django.test import signals
File "<frozen importlib._bootstrap>", line 968, in _find_and_load
File "<frozen importlib._bootstrap>", line 149, in __enter__
File "<frozen importlib._bootstrap>", line 94, in acquire
_frozen_importlib._DeadlockError: deadlock detected by
_ModuleLock('django.test.signals') at 139722400476576
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:10>
* status: new => closed
* resolution: => needsinfo
Comment:
Please [https://docs.djangoproject.com/en/stable/internals/contributing
/triaging-tickets/#closing-tickets follow triaging guidelines with regards
to needsinfo tickets.] To reopen this ticket you should provide a test
project.
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:11>
Comment (by leopd):
FWIW, I'm seeing this error too. It happens to me after code has been
changed and it's trying to reload, likely while a request is being served.
I'm running the default dev server, django 2.2.3, on python 3.7.1.
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:12>
Comment (by hawkinsw):
I, too, had this exact same problem. It was the result of having pyc files
that were out of date. The problem bit us specifically in the context of a
rebuild in a docker container. Simply removing the pyc files made this go
away. I know it sounds unlikely, but it's true. I hope that helps.
Will
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:13>
* cc: hawkinsw (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:14>
Comment (by Man Python):
https://code.djangoproject.com/ticket/30921 not sure is duplicated..
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:15>
Comment (by JudgeGregg):
See https://github.com/encode/django-rest-framework/issues/7078
Upgrading django-rest-framework to >= 3.11 should mitigate this.
--
Ticket URL: <https://code.djangoproject.com/ticket/30352#comment:16>