juliomalegria / django-chunked-upload

Upload large files to Django in multiple chunks, with the ability to resume if the upload is interrupted.
MIT No Attribution
214 stars 71 forks source link

Use import path for storage model instead of class #29

Closed dunkelstern closed 7 years ago

dunkelstern commented 7 years ago

When your Storage model uses a real model you will get the message that the "App has not been loaded yet" on Django startup.

When using an import path like in Django middleware definitions the actual importing of the storage backend will be delayed until the settings.py file of chunked-upload will be called. This is after the models have been loaded and initialized.

This PR changes from:

from xy.storage import StorageClass
CHUNKED_UPLOAD_STORAGE_CLASS = StorageClass

to:

CHUNKED_UPLOAD_STORAGE_CLASS = "xy.storage.StorageClass"
dunkelstern commented 7 years ago

Sorry we committed stuff directly into the branch here... closing and reopening in a clean state.