2017-02-10 3 views
0

Pythonのバージョン:3.6
データベースが無効なdatetime値を返しました。データベースとpytzのタイムゾーン定義はインストールされていますか?

OS:Windowsの10

MySQLバージョン:5.7

私はDjangoのアプリを持っています。環境:

Environment: 


Request Method: GET 
Request URL: http://localhost:8000/blog/archive/ 

Django Version: 1.10.5 
Python Version: 3.6.0 
Installed Applications: 
['django.contrib.admin', 
'django.contrib.auth', 
'django.contrib.contenttypes', 
'django.contrib.sessions', 
'django.contrib.messages', 
'django.contrib.staticfiles', 
'bookmark.apps.BookmarkConfig', 
'blog.apps.BlogConfig'] 
Installed Middleware: 
['django.middleware.security.SecurityMiddleware', 
'django.contrib.sessions.middleware.SessionMiddleware', 
'django.middleware.common.CommonMiddleware', 
'django.middleware.csrf.CsrfViewMiddleware', 
'django.contrib.auth.middleware.AuthenticationMiddleware', 
'django.contrib.messages.middleware.MessageMiddleware', 
'django.middleware.clickjacking.XFrameOptionsMiddleware'] 



Traceback: 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py" in inner 
    39.    response = get_response(request) 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\base.py" in _get_response 
    187.     response = self.process_exception_by_middleware(e, request) 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\base.py" in _get_response 
    185.     response = wrapped_callback(request, *callback_args, **callback_kwargs) 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\views\generic\base.py" in view 
    68.    return self.dispatch(request, *args, **kwargs) 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\views\generic\base.py" in dispatch 
    88.   return handler(request, *args, **kwargs) 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\views\generic\dates.py" in get 
    339.   self.date_list, self.object_list, extra_context =  self.get_dated_items() 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\views\generic\dates.py" in get_dated_items 
    425.   date_list = self.get_date_list(qs, ordering='DESC') 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\views\generic\dates.py" in get_date_list 
    404.   if date_list is not None and not date_list and not allow_empty: 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\query.py" in __bool__ 
    260.   self._fetch_all() 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\query.py" in _fetch_all 
    1087.    self._result_cache = list(self.iterator()) 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\query.py" in __iter__ 
    155.   for row in compiler.results_iter(): 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\sql\compiler.py" in results_iter 
    795.      row = self.apply_converters(row, converters) 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\sql\compiler.py" in apply_converters 
    779.     value = converter(value, expression, self.connection, self.query.context) 

File "C:\Users\ikks0\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\functions\datetime.py" in convert_value 
    181.       "Database returned an invalid datetime value. " 

Exception Type: ValueError at /blog/archive/ 
Exception Value: Database returned an invalid datetime value. Are time zone definitions for your database and pytz installed? 

私は "MySQL mysql_tzinfo_to_sql program" にしようと試みた今、私はこれらのエラーを取得しています。しかし、それはうまくいかない。

解決策は何ですか?

答えて

関連する問題