django-admin startproject diaryで作成したmanage.pyを実行してサーバーを起動させようとする次のエラ-ができました。
python
1#!/usr/bin/env python 2"""Django's command-line utility for administrative tasks.""" 3import os 4import sys 5 6 7def main(): 8 os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'private_diary.settings') 9 try: 10 from django.core.management import execute_from_command_line 11 except ImportError as exc: 12 raise ImportError( 13 "Couldn't import Django. Are you sure it's installed and " 14 "available on your PYTHONPATH environment variable? Did you " 15 "forget to activate a virtual environment?" 16 ) from exc 17 execute_from_command_line(sys.argv) 18 19 20if __name__ == '__main__': 21 main() 22
$ python manage.py runserver
error
1/home/yuyonod/venv_private_diary/bin/python /home/yuyonod/venv_private_diary/private_diary/manage.py runserver 2Exception in thread django-main-thread: 3Traceback (most recent call last): 4 File "/home/yuyonod/anaconda3/lib/python3.7/logging/config.py", line 760, in add_handlers 5 logger.addHandler(self.config['handlers'][h]) 6 File "/home/yuyonod/anaconda3/lib/python3.7/logging/config.py", line 323, in __getitem__ 7 value = dict.__getitem__(self, key) 8KeyError: 'console' 9 10The above exception was the direct cause of the following exception: 11 12Traceback (most recent call last): 13 File "/home/yuyonod/anaconda3/lib/python3.7/logging/config.py", line 616, in configure 14 self.configure_logger(name, loggers[name]) 15 File "/home/yuyonod/anaconda3/lib/python3.7/logging/config.py", line 785, in configure_logger 16 self.common_logger_config(logger, config, incremental) 17 File "/home/yuyonod/anaconda3/lib/python3.7/logging/config.py", line 777, in common_logger_config 18 self.add_handlers(logger, handlers) 19 File "/home/yuyonod/anaconda3/lib/python3.7/logging/config.py", line 762, in add_handlers 20 raise ValueError('Unable to add handler %r' % h) from e 21ValueError: Unable to add handler 'console' 22 23The above exception was the direct cause of the following exception: 24 25Traceback (most recent call last): 26 File "/home/yuyonod/anaconda3/lib/python3.7/threading.py", line 917, in _bootstrap_inner 27 self.run() 28 File "/home/yuyonod/anaconda3/lib/python3.7/threading.py", line 865, in run 29 self._target(*self._args, **self._kwargs) 30 File "/home/yuyonod/venv_private_diary/lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper 31 fn(*args, **kwargs) 32 File "/home/yuyonod/venv_private_diary/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run 33 autoreload.raise_last_exception() 34 File "/home/yuyonod/venv_private_diary/lib/python3.7/site-packages/django/utils/autoreload.py", line 76, in raise_last_exception 35 raise _exception[1] 36 File "/home/yuyonod/venv_private_diary/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute 37 autoreload.check_errors(django.setup)() 38 File "/home/yuyonod/venv_private_diary/lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper 39 fn(*args, **kwargs) 40 File "/home/yuyonod/venv_private_diary/lib/python3.7/site-packages/django/__init__.py", line 19, in setup 41 configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) 42 File "/home/yuyonod/venv_private_diary/lib/python3.7/site-packages/django/utils/log.py", line 75, in configure_logging 43 logging_config_func(logging_settings) 44 File "/home/yuyonod/anaconda3/lib/python3.7/logging/config.py", line 799, in dictConfig 45 dictConfigClass(config).configure() 46 File "/home/yuyonod/anaconda3/lib/python3.7/logging/config.py", line 619, in configure 47 '%r' % name) from e 48ValueError: Unable to configure logger 'diary' 49
どうしたらエラーなくサーバーを起動できますか?
回答1件
あなたの回答
tips
プレビュー