theriverman / django-minio-backend

Minio Backend for Django
https://pypi.org/project/django-minio-backend/
MIT License
112 stars 22 forks source link

Import timedelta in models.py #13

Closed dbik closed 4 years ago

dbik commented 4 years ago

Hey I got this error:

File "/usr/local/lib/python3.8/site-packages/django_minio_backend/models.py", line 177, in url     

  expires=get_setting("MINIO_URL_EXPIRY_HOURS", timedelta(days=7))  # Default is 7 days

NameError: name 'timedelta' is not defined

An import like this in models.py should fix it..?

from datetime import timedelta
theriverman commented 4 years ago

Hi @dbik , Yes, adding from datetime import timedelta should fix that problem.