2016-08-30 9 views
0

Django 1.10으로 업그레이드 한 후 오류가 발생했습니다. Python 3.5에서 장고 1.10을 django-storages==1.5.0boto3==1.4.0으로 실행하고 있습니다.장고 1.10 : S3 오류에 django-storage : 순진한 datetime이 아닙니다 (tzinfo가 이미 설정되어 있습니다)

You have requested to collect static files at the destination 
location as specified in your settings. 

This will overwrite existing files! 
Are you sure you want to do this? 

Type 'yes' to continue, or 'no' to cancel: yes 
Traceback (most recent call last): 
    File "./manage.py", line 10, in <module> 
    execute_from_command_line(sys.argv) 
    File "/home/vagrant/.virtualenvs/wrds-classroom/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line 
    utility.execute() 
    File "/home/vagrant/.virtualenvs/wrds-classroom/lib/python3.5/site-packages/django/core/management/__init__.py", line 359, in execute 
    self.fetch_command(subcommand).run_from_argv(self.argv) 
    File "/home/vagrant/.virtualenvs/wrds-classroom/lib/python3.5/site-packages/django/core/management/base.py", line 305, in run_from_argv 
    self.execute(*args, **cmd_options) 
    File "/home/vagrant/.virtualenvs/wrds-classroom/lib/python3.5/site-packages/django/core/management/base.py", line 356, in execute 
    output = self.handle(*args, **options) 
    File "/home/vagrant/.virtualenvs/wrds-classroom/lib/python3.5/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 193, in handle 
    collected = self.collect() 
    File "/home/vagrant/.virtualenvs/wrds-classroom/lib/python3.5/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 124, in collect 
    handler(path, prefixed_path, storage) 
    File "/home/vagrant/.virtualenvs/wrds-classroom/lib/python3.5/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 337, in copy_file 
    if not self.delete_file(path, prefixed_path, source_storage): 
    File "/home/vagrant/.virtualenvs/wrds-classroom/lib/python3.5/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 258, in delete_file 
    target_last_modified = self.storage.get_modified_time(prefixed_path) 
    File "/home/vagrant/.virtualenvs/wrds-classroom/lib/python3.5/site-packages/django/core/files/storage.py", line 231, in get_modified_time 
    return _possibly_make_aware(dt) 
    File "/home/vagrant/.virtualenvs/wrds-classroom/lib/python3.5/site-packages/django/core/files/storage.py", line 243, in _possibly_make_aware 
    return timezone.make_aware(dt, tz).astimezone(timezone.utc) 
    File "/home/vagrant/.virtualenvs/wrds-classroom/lib/python3.5/site-packages/django/utils/timezone.py", line 368, in make_aware 
    return timezone.localize(value, is_dst=is_dst) 
    File "/home/vagrant/.virtualenvs/wrds-classroom/lib/python3.5/site-packages/pytz/tzinfo.py", line 304, in localize 
    raise ValueError('Not naive datetime (tzinfo is already set)') 
ValueError: Not naive datetime (tzinfo is already set) 

False-USE_TZ 오류를 변경 Changeing,하지만 난 여전히이 발생하는 이유 확실하지 않다 (이 나를 위해 장고 코드베이스의 새로운 영토) :

TypeError: can't compare offset-naive and offset-aware datetimes 

어떤 생각이 무엇을 여기의 원인은 무엇입니까?

답변

0

UPDATE :

나는이 풀 요청은 이제 통합 된 것처럼, 내 자신의 대답을 업데이트하고 있습니다. 해결하려면 단순히 requirements.txt 또는 pip install 명령 버전 1.5.1를 사용 : 문맥 날짜 답변의

django-storages==1.5.1 

OUT : 나는 영구적 인 해결로 연결되어야 임시 수정 사항을 알아 냈어요

합니다.

좀 더 뒤를 쫓고 후, 친구가 관련이있을 거라고 생각이 PR 발견 : 나는 풀 요청 일을 발견

https://github.com/jschneier/django-storages/pull/181 이틀 최신 장고 - 스토리지 출시 (1.5.0) 후였다을하는 I 달리고 있었다. 내 requirements.txt에서 나는 단순히 커밋의 해시 가리키는 이런 짓을 :

#django-storages==1.5.0 
git+https://github.com/jschneier/django-storages.git#5f280571ee1ae93ee66ed805b53b08bfe5ab9f0c 
boto3==1.4.0 

다음, pip install --upgrade -r requirements.txt하고 다시 collectstatic를 실행하지 않고, 더 이상 오류! 이 픽스가 1.5.1 릴리스에 포함될 것이라고 추측합니다.이 시점에서 다시 requirements.txt을 다시 변경합니다.