当我将 pytz == 2018.7 更新为 pytz == 2019.1 时,我的Django服务器崩溃了。所有时区计算均由Pytz库负责。我问自己是否有所改变,在哪里可以找到变更日志? 我没有更改Django项目中与时间相关的任何内容,当我回到 pytz == 2018.7 时,一切正常。 我正在将Django 2.2与virtualenv一起使用,这是我的列表
Python==3.7.2
Django 2.2
Virtualenv==16.5.0
Django==2.2
django-widget-tweaks==1.4.3
djangorestframework==3.9.2
Pillow==6.0.0
Pygments==2.3.1
pytz==2018.7
sqlparse==0.3.0
Settings.py
# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
<…>
使用pytz == 2019.1更新的最新崩溃
(env2) D:\coding\Webprojects\phone>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "D:\coding\virtual_env\env2\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "D:\coding\virtual_env\env2\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "D:\coding\virtual_env\env2\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "D:\coding\virtual_env\env2\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "D:\coding\virtual_env\env2\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "D:\coding\virtual_env\env2\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "D:\coding\virtual_env\env2\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "D:\coding\virtual_env\env2\lib\site-packages\django\utils\autoreload.py", line 579, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "D:\coding\virtual_env\env2\lib\site-packages\django\utils\autoreload.py", line 564, in start_django
reloader.run(django_main_thread)
File "D:\coding\virtual_env\env2\lib\site-packages\django\utils\autoreload.py", line 272, in run
get_resolver().urlconf_module
File "D:\coding\virtual_env\env2\lib\site-packages\django\utils\functional.py", line 80, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "D:\coding\virtual_env\env2\lib\site-packages\django\urls\resolvers.py", line 564, in urlconf_module
return import_module(self.urlconf_name)
File "D:\coding\virtual_env\env2\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
Exception in thread Thread-1:
Traceback (most recent call last):
File "D:\coding\virtual_env\env2\lib\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 "d:\coding\appz\python 3_7_2_64bit\Lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "d:\coding\appz\python 3_7_2_64bit\Lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "D:\coding\virtual_env\env2\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "D:\coding\virtual_env\env2\lib\site-packages\django\core\management\commands\runserver.py", line 117, in inner_run
self.check(display_num_errors=True)
File "D:\coding\virtual_env\env2\lib\site-packages\django\core\management\base.py", line 390, in check
include_deployment_checks=include_deployment_checks,
File "D:\coding\virtual_env\env2\lib\site-packages\django\core\management\base.py", line 377, in _run_checks
return checks.run_checks(**kwargs)
File "D:\coding\virtual_env\env2\lib\site-packages\django\core\checks\registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "D:\coding\virtual_env\env2\lib\site-packages\django\contrib\admin\checks.py", line 80, in check_dependencies
for engine in engines.all():
File "D:\coding\virtual_env\env2\lib\site-packages\django\template\utils.py", line 90, in all
return [self[alias] for alias in self]
File "D:\coding\virtual_env\env2\lib\site-packages\django\template\utils.py", line 90, in <listcomp>
return [self[alias] for alias in self]
File "D:\coding\virtual_env\env2\lib\site-packages\django\template\utils.py", line 81, in __getitem__
engine = engine_cls(params)
File "D:\coding\virtual_env\env2\lib\site-packages\django\template\backends\django.py", line 25, in __init__
options['libraries'] = self.get_templatetag_libraries(libraries)
File "D:\coding\virtual_env\env2\lib\site-packages\django\template\backends\django.py", line 43, in get_templatetag_libraries
libraries = get_installed_libraries()
File "D:\coding\virtual_env\env2\lib\site-packages\django\template\backends\django.py", line 108, in get_installed_libraries
for name in get_package_libraries(pkg):
File "D:\coding\virtual_env\env2\lib\site-packages\django\template\backends\django.py", line 121, in get_package_libraries
module = import_module(entry[1])
File "D:\coding\virtual_env\env2\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:\coding\virtual_env\env2\lib\site-packages\rest_framework\templatetags\rest_framework.py", line 15, in <module>
from rest_framework.renderers import HTMLFormRenderer
File "D:\coding\virtual_env\env2\lib\site-packages\rest_framework\renderers.py", line 20, in <module>
from django.test.client import encode_multipart
File "D:\coding\virtual_env\env2\lib\site-packages\django\test\client.py", line 23, in <module>
from django.test import signals
File "<frozen importlib._bootstrap>", line 980, 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 2019111034216
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:\coding\Webprojects\phone\phone\urls.py", line 27, in <module>
path('data/', include('dataout.urls', namespace='data_home')),
File "D:\coding\virtual_env\env2\lib\site-packages\django\urls\conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "D:\coding\virtual_env\env2\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:\coding\Webprojects\phone\dataout\urls.py", line 2, in <module>
from rest_framework.urlpatterns import format_suffix_patterns
File "D:\coding\virtual_env\env2\lib\site-packages\rest_framework\urlpatterns.py", line 8, in <module>
from rest_framework.settings import api_settings
File "D:\coding\virtual_env\env2\lib\site-packages\rest_framework\settings.py", line 26, in <module>
from django.test.signals import setting_changed
File "D:\coding\virtual_env\env2\lib\site-packages\django\test\__init__.py", line 3, in <module>
from django.test.client import Client, RequestFactory
ImportError: cannot import name 'Client' from 'django.test.client' (D:\coding\virtual_env\env2\lib\site-packages\django\test\client.py)