Giter Site home page Giter Site logo

imperialcollegelondon / django-drf-filepond Goto Github PK

View Code? Open in Web Editor NEW
103.0 7.0 39.0 668 KB

A Django app providing a server implemention for the Filepond file upload library

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
file-upload filepond django-application

django-drf-filepond's Introduction

django-drf-filepond: A filepond server implementation for Django + Django REST Framework

PyPI version Supported python versions test status Documentation Status

django-drf-filepond is a Django app that provides a filepond server-side implementation for Django/Django REST Framework projects. The app can be easily added to your Django projects to provide a server-side API for the filepond file upload library.

django-drf-filepond supports remote storage of uploads via django-storages

🆕 Release v0.5.0 is now available including Python 3.10 support, memory efficiency improvements when working with large files, bug fixes and updates to the testing infrastructure along with improved test coverage.

⚠️ Release v0.5.0 deprecates Python 2.7 and Python 3.5 support. This will be the last release to support Python 2.7 and Python 3.5. Both these versions of Python have now been "end-of-life" since 2020.

⚠️ Release v0.4.0 includes a database update in relation to the large upload support. If you don't wish to apply DB migrations within your application at this stage, please continue to use django-drf-filepond v0.3.1. ⚠️

See the Release Notes section for further release information.

Further documentation and a tutorial are available at https://django-drf-filepond.readthedocs.io.

Installation

The app can be installed from PyPi:

pip install django-drf-filepond

or add it to your list of dependencies in a requirements.txt file.

Configuration

There are three key configuration updates to make within your Django application to set up django-drf-filepond:

1. Add the app to INSTALLED_APPS:

Add 'django-drf-filepond' to INSTALLED_APPS in your Django settings file (e.g. settings.py):

...

INSTALLED_APPS = [
	...,
	'django_drf_filepond'
]

...
2. Set the temporary file upload location:

Set the location where you want django-drf-filepond to store temporary file uploads by adding the DJANGO_DRF_FILEPOND_UPLOAD_TMP configuration variable to your settings file, e.g.:

import os
...
DJANGO_DRF_FILEPOND_UPLOAD_TMP = os.path.join(BASE_DIR, 'filepond-temp-uploads')
...
3. Include the app urls into your main url configuration

Add the URL mappings for django-drf-filepond to your URL configuration in urls.py:

from django.urls import re_path, include

urlpatterns = [
	...
	re_path(r'^fp/', include('django_drf_filepond.urls')),
]

On the client side, you need to set the endpoints of the process, revert, fetch, load, restore and patch functions to match the endpoint used in your path statement above. For example if the first parameter to re_path is fp/ then the endpoint for the process function will be /fp/process/.

(Optional) 4. File storage configuration

Initially, uploaded files are stored in a temporary staging area (the location you set in item 2 above, with the DJANGO_DRF_FILEPOND_UPLOAD_TMP parameter. At this point, an uploaded file is still shown in the filepond UI on the client and the user can choose to cancel the upload resulting in the file being deleted from temporary storage and the upload being cancelled. When a user confirms a file upload, e.g. by submitting the form in which the filepond component is embedded, any temporary uploads need to be moved to a permanent storage location.

There are three different options for file storage:

  • Use a location on a local filesystem on the host server for file storage (see Section 4.1)

  • Use a remote file storage backend via the django-storages library (see Section 4.2)

  • Manage file storage yourself, independently of django-drf-filepond (in this case, filepond load functionality is not supported)

More detailed information on handling file uploads and using the django-drf-filepond API to store them is provided in the Working with file uploads section below.

4.1 Storage of filepond uploads using the local file system

To use the local filesystem for storage, you need to specify where to store files. Set the DJANGO_DRF_FILEPOND_FILE_STORE_PATH parameter in your Django application settings file to specify the base location where stored uploads will be placed, e.g.:

...
DJANGO_DRF_FILEPOND_FILE_STORE_PATH = os.path.join(BASE_DIR, 'stored_uploads')
...

The specified path for each stored upload will then be created relative to this location. For example, given the setting shown above, if BASE_DIR were /tmp/django-drf-filepond, then a temporary upload with the specified target location of either /mystoredupload/uploaded_file.txt or mystoredupload/uploaded_file.txt would be stored to /tmp/django-drf-filepond/stored_uploads/mystoredupload/uploaded_file.txt

When using local file storage, DJANGO_DRF_FILEPOND_FILE_STORE_PATH is the only required setting.

4.2 Remote storage of filepond uploads via django-storages

The django-storages library provides support for a number of different remote file storage backends. The django-storages documentation lists the supported backends.

To enable django-storages support for django-drf-filepond, set the DJANGO_DRF_FILEPOND_STORAGES_BACKEND parameter in your application configuration to the django-storages backend that you wish to use. You need to specify the fully-qualified class name for the storage backend that you want to use. This is the same value that would be used for the django-storages DEFAULT_FILE_STORAGE parameter and the required value can be found either by looking at the django-storages documentation for the backend that you want to use, or by looking at the code on GitHub.

For example, if you want to use the SFTP storage backend, add the following to your application settings:

...
DJANGO_DRF_FILEPOND_STORAGES_BACKEND = \
	'storages.backends.sftpstorage.SFTPStorage'
...

or, for the Amazon S3 backend:

...
DJANGO_DRF_FILEPOND_STORAGES_BACKEND = 'storages.backends.s3boto3.S3Boto3Storage'
...

For each storage backend, there are a number of additional django-storages configuration options that must be specified. These are detailed in the django-storages documentation.

The following is an example of a complete set of configuration parameters for using an Amazon S3 storage backend for django-drf-filepond via django-storages:

	...
	DJANGO_DRF_FILEPOND_STORAGES_BACKEND = 'storages.backends.s3boto3.S3Boto3Storage'
	AWS_ACCESS_KEY_ID = '<YOUR AWS ACCESS KEY>'
	AWS_SECRET_ACCESS_KEY = '<YOUR AWS SECRET KEY>'
	AWS_STORAGE_BUCKET_NAME = 'django-drf-filepond'
	AWS_AUTO_CREATE_BUCKET = True
	AWS_S3_REGION_NAME = 'eu-west-1'
	...

NOTE: django-storages is now included as a core dependency of django-drf-filepond. However, the different django-storages backends each have their own additional dependencies which you need to install manually or add to your own app's dependencies.

You can add additional dependencies using pip by specifying the optional extras feature tag, e.g. to install additional dependencies required for django-storages' Amazon S3 support run:

	$ pip install django-storages[boto3]

See the Working with file uploads section for more details on how to use the django-drf-filepond API to store files to a local or remote file store.

NOTE: DJANGO_DRF_FILEPOND_FILE_STORE_PATH is not used when using a remote file store backend. It is recommended to remove this setting or leave it set to None.

The base storage location for a remote file storage backend from django-storages is set using a setting specific to the backend that you are using - see the django-storages documentation for your chosen backend for further information.

(Optional) 4. Set the permanent file store location

If you wish to let django-drf-filepond manage the permanent storage of file uploads (note that this is required if you wish to use the load method), you need to set DJANGO_DRF_FILEPOND_FILE_STORE_PATH in your application settings file, e.g.

...
DJANGO_DRF_FILEPOND_FILE_STORE_PATH = os.path.join(BASE_DIR, 'stored_uploads')
...

See "Working with file uploads" below for more information on how to move temporary uploads to django-drf-filepond-managed permanent storage.

Working with file uploads

When a file is uploaded from a filepond client, the file is placed into a uniquely named directory within the temporary upload directory specified by the DJANGO_DRF_FILEPOND_UPLOAD_TMP parameter. As per the filepond server spec, the server returns a unique identifier for the file upload. In this case, the identifier is a 22-character unique ID generated using the shortuuid library. This ID is the name used for the directory created under DJANGO_DRF_FILEPOND_UPLOAD_TMP into which the file is placed. At present, the file also has a separate unique identifier which hides the original name of the file on the server filesystem. The original filename is stored within the django-drf-filepond app's database.

When/if the client subsequently submits the form associated with the filepond instance that triggered the upload, the unique directory ID will be passed and this can be used to look up the temporary file.

Chunked uploads

django-drf-filepond now supports filepond chunked uploads. There is no configuration required for django-drf-filepond on the server side to handle chunked uploads.

On the client side, you need to ensure that your filepond configuration specifies server endpoints for both the process and patch methods and that you have the required configuration options in place to enable chunked uploads. For example, if you want to enable chunkUploads and send uploads in 500,000 byte chunks, your filepond configuration should include properties similar to the following:

FilePond.setOptions({
    ...
    chunkUploads: true,
    chunkSize: 500000,
    server: {
        url: 'https://.../fp',
        process: '/process/',
        patch: '/patch/',
        revert: '/revert/',
        fetch: '/fetch/?target='
    }
    ...
});

Storing file uploads

There are two different approaches for handling temporary uploads that need to be stored permanently on a server after being uploaded from a filepond client via django-drf-filepond. These two approaches are not mutually exclusive and you can choose to use one approach for some files and the other approach for other files if you wish.

1. Manual handling of file storage

Using this approach, you move the file initially stored as a temporary upload by django-drf-filepond to a storage location of your choice and the file then becomes independent of django-drf-filepond. The following example shows how to lookup a temporary upload given its unique upload ID and move it to a permanent storage location. The temporary upload record is then deleted and django-drf-filepond no longer has any awareness of the file:

import os
from django_drf_filepond.models import TemporaryUpload

# Get the temporary upload record
tu = TemporaryUpload.objects.get(upload_id='<22-char unique ID>')

# Move the file somewhere for permanent storage
# The file will be saved with its original name
os.rename(tu.get_file_path(), '/path/to/permanent/location/%s' % tu.upload_name)

# Delete the temporary upload record and the temporary directory
tu.delete()
2. Use django-drf-filepond's API to store a temporary upload to permanent storage

Note: You must use this approach for storing any files that you subsequently want to access using filepond's load function.

Using this approach, the file is stored either to local storage or to a remote storage service depending on the file store configuration you are using.

2.1 store_upload

store_upload stores a temporary upload, uploaded as a result of adding it to the filepond component in a web page, to permanent storage.

If you have configured django-drf-filepond to use local file storage by setting the DJANGO_DRF_FILEPOND_FILE_STORE_PATH parameter in your application settings, the file will be stored to a location under this directory.

If you have configured a remote file store via django-storages, the stored upload will be sent to the configured storage backend via django-storages.

Parameters:

upload_id: The unique ID assigned to the upload by django-drf-filepond when the file was initially uploaded via filepond.

destination_file_path: The location where the file should be stored. This location will be appended to the base file storage location as defined using the DJANGO_DRF_FILEPOND_FILE_STORE_PATH parameter, or, for remote storage backends, the location configured using the relevant django-storages parameters. If you pass an absolute path beginning with /, the leading / will be removed. The path that you provide should also include the target filename.

Returns:

A django_drf_filepond.models.StoredUpload object representing the stored upload.

Raises django.core.exceptions.ImproperlyConfigured if using a local file store and DJANGO_DRF_FILEPOND_FILE_STORE_PATH has not been set.

Raises ValueError if:

  • an upload_id is provided in an invalid format
  • the destination_file_path is not provided
  • a django_drf_filepond.models.TemporaryUpload record for the provided upload_id is not found

Example:

from django_drf_filepond.api import store_upload

# Given a variable upload_id containing a 22-character unique file upload ID:
su = store_upload(upload_id, destination_file_path='target_dir/filename.ext')
# destination_file_path is a relative path (including target filename. 
# The path will created under the file store directory and the original 
# temporary upload will be deleted.
2.2 get_stored_upload / get_stored_upload_file_data

Get access to a stored upload and the associated file data.

get_stored_upload: Given an upload_id, return the associated django_drf_filepond.models.StoredUpload object.

Throws django_drf_filepond.models.StoredUpload.DoesNotExist if a database record doesn't exist for the specified upload_id.

get_stored_upload_file_data: Given a StoredUpload object, return the file data for the upload as a Python file-like object.

Parameters:

stored_upload: A django_drf_filepond.models.StoredUpload object for which you want retrieve the file data.

Returns:

Returns a tuple (filename, bytes_io) where filename is a string representing the name of the stored file being returned and bytes_io is an io.BytesIO object from which the file data can be read. If an error occurs, raises an exception:

  • django_drf_filepond.exceptions.ConfigurationError: Thrown if using a local file store and DJANGO_DRF_FILEPOND_FILE_STORE_PATH is not set or the specified location does not exist, or is not a directory.
  • FileNotFoundError: Thrown if using a remote file store and the file store API reports that the file doesn't exist. If using a local file store, thrown if the file does not exist or the location is a directory and not a file.
  • IOError: Thrown if using a local file store and reading the file fails.

Example:

from django_drf_filepond.api import get_stored_upload
from django_drf_filepond.api import get_stored_upload_file_data

# Given a variable upload_id containing a 22-character unique 
# upload ID representing a stored upload:
su = get_stored_upload(upload_id)
(filename, bytes_io) = get_stored_upload_file_data(su)
file_data = bytes_io.read()
2.3 delete_stored_upload

delete_stored_upload deletes a stored upload record and, optionally, the associated file that is stored on either a local disk or a remote file storage service.

Parameters:

upload_id: The unique ID assigned to the upload by django-drf-filepond when the file was initially uploaded via filepond.

delete_file: True to delete the file associated with the record, False to leave the file in place.

Returns:

Returns True if the stored upload is deleted successfully, otherwise raises an exception:

  • django_drf_filepond.models.StoredUpload.DoesNotExist exception if no upload exists for the specified upload_id.
  • django_drf_filepond.exceptions.ConfigurationError: Thrown if using a local file store and DJANGO_DRF_FILEPOND_FILE_STORE_PATH is not set or the specified location does not exist, or is not a directory.
  • FileNotFoundError: Thrown if using a remote file store and the file store API reports that the file doesn't exist. If using a local file store, thrown if the file does not exist or the location is a directory and not a file.
  • OSError: Thrown if using a local file store and the file deletion fails.
from django_drf_filepond.api import delete_stored_upload

# Given a variable upload_id containing a 22-character unique 
# upload ID representing a stored upload:
delete_stored_upload(upload_id, delete_file=True)
# delete_file=True will delete the file from the local 
# disk or the remote storage service.

DRF Permissions

By default no permissions are applied on API endpoints. If you want to assign certain permissions such as rest_framework.permissions.IsAuthenticated you can do it like so:

DJANGO_DRF_FILEPOND_PERMISSION_CLASSES = {
    'GET_FETCH': ['rest_framework.permissions.IsAuthenticated', ],
    'GET_LOAD': ['rest_framework.permissions.IsAuthenticated', ],
    'POST_PROCESS': ['rest_framework.permissions.IsAuthenticated', ],
    'GET_RESTORE': ['rest_framework.permissions.IsAuthenticated', ],
    'DELETE_REVERT': ['rest_framework.permissions.IsAuthenticated', ],
    'PATCH_PATCH': ['rest_framework.permissions.IsAuthenticated', ],
}

You can add more than one permission for each endpoint.

The above list includes all the permission names currently defined on django-drf-filepond views. The naming convention used is <METHOD_NAME>_<ENDPOINT_NAME> where <METHOD_NAME> is the method name used for a request and <ENDPOINT_NAME> is the URL endpoint called. So, for example, a POST request to /fp/process would be handled by the permission classes defined for POST_PROCESS.

Release notes

v0.5.0

django-drf-filepond v0.5.0 includes additional functionality and bug fixes:

  • Add Python 3.10 support
  • Memory efficiency improvements when handling large files. Previously, the way chunked uploads were handled meant that twice as much memory as the size of an upload was being used. This has been resolved with an extensive redesign of the chunked upload handler.
  • Testing of the code has been switched to use Pytest with Tox.
  • Test coverage has been significantly improved.

⚠️ Please note: v0.5.0 deprecates Python 2.7 and Python 3.5 support. This will be the last release to support Python 2.7 and Python 3.5. Both these versions of Python have now been "end-of-life" since 2020. ⚠️

See full details of the particular changes merged in the v0.5.0 release notes on GitHub.

v0.4.0
  • Adds support for large file uploads (> ~2GB) (see #57).

⚠️ Release v0.4.0 includes a database update in relation to the large upload support. If you don't wish to apply DB migrations within your application at this stage, please continue to use django-drf-filepond v0.3.1. ⚠️

v0.3.0
  • Adds support for filepond chunked uploads.

License

This repository is licensed under a BSD 3-Clause license. Please see the LICENSE file in the root of the repository.

Acknowledgements

Thanks to pqina for producing the filepond file upload library that this Django app provides server-side support for.

The django-drf-filepond app has been built as part of work that is being supported by UK Research and Innovation (Engineering and Physical Sciences Research Council) under grant EP/R025460/1.

django-drf-filepond's People

Contributors

akindofyoga avatar alarivas avatar dependabot[bot] avatar gaetano-guerriero avatar hrushikeshrv avatar hvitis avatar incred avatar iver56 avatar jcohen02 avatar mwoodbri avatar pasevin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-drf-filepond's Issues

Have some questions about using permanent storage functions.

The permanent storage is written in python, and how to use it after uploading the file on the frontend web page. It was confusing me, can you please give me some advices.
Or in another way, how to trigger this permanent store operation after uploading files.

high memory usage caused by chunks being combined in-mem

On large file uploads we're seeing heavy memory usage, roughly 2x the size of an upload while finalizing the upload.
After a lot of digging, it turns out that the culprit seems to be how django-drf-filepond pieces together chunks by using an in-mem BytesIO object. The "2x" usage seems to be related to copies of that BytesIO object.

We've created a poc that's using python tempfiles instead of BytesIO, and moves files rather than copies them, in order to avoid slowing down the upload finalizer. We're prepared to spend time cleaning this up and creating a PR for that, but before doing so I was wondering if we should attempt to make the choice of in-mem or tempfile configurable using a setting? Doing so would cause some extra complexities, so it would take us some extra time but in terms of backwards compatability it would be safer I guess. For smaller uploads I guess the in-mem method is slightly faster too. Maybe we could even make it so that small uploads are pieced together in-mem while larger ones are built using tempfiles.

In any case, would be good to get some feedback from the maintainers on this.

Is there a way to link each uploaded files with an other model by forgnekey or Abstract model?

Hello There,

I want to know how can i link each uploaded file with an post model like each post has multiple files(photos/videos). When the user click submit button the post is created and Each file get's uploaded along with it? In my case when the user click submit button The post is created but the files which are uploaded by the user are not getting post along with it. Would you like to guide me about working of function mantioned above? And do the needfull.

models.py

class StoredUpload(models.Model):
    post = models.ForeignKey(Post, on_delete=models.CASCADE, null=True) # This is the article model ForeignKey

    # The unique upload ID assigned to this file when it was originally
    upload_id = models.CharField(
        primary_key=True, max_length=22, validators=[MinLengthValidator(22)]
    )
    file = models.FileField(storage=DrfFilePondStoredStorage(), max_length=2048)
    uploaded = models.DateTimeField()
    stored = models.DateTimeField(auto_now_add=True)
    uploaded_by = models.ForeignKey(
        settings.AUTH_USER_MODEL, null=True, blank=True, on_delete=models.CASCADE
    )

views.py

class SubmitFormView(View):
    form_class = PostForm

    # Handle POST request
    def post(self, request):
        form = self.form_class(request.POST)
        if form.is_valid():
            post = form.save()

        # StoredUpload(post=post)  # did't get anything here!
        # Get the post request and extract the IDs of the temporary upload(s)
        # to be permanently stored.
        data = request.POST
        filepond_ids = data.getlist("filepond")
        stored_uploads = []
        for upload_id in filepond_ids:
            tu = TemporaryUpload.objects.get(upload_id=upload_id)
            store_upload(upload_id, os.path.join(upload_id, tu.upload_name))
            stored_uploads.append(upload_id)

        # Return the list of uploads that were stored.
        return HttpResponse(
            json.dumps({"status": "OK", "uploads": stored_uploads}),
            content_type="application/json",
        )

Clarify resulting error message when 'upload_field_name' is not found in request data while uploading

As explained in the comment just above this referenced line of code, if there are multiple filepond instances on the page, or if the developer has chosen to name the input element something other that 'filepond', they need to send the name they have used as 'upload_field_name'.

raise ParseError('Invalid request data has been provided.')

If this name is not found in the request data, we currently just say Invalid request data has been provided., but I feel that this error message should be made more explicit, telling the user what specifically in the request was invalid. Maybe we could say something like Couldn't find the name of the input field in the request data. This may happen if you are using multiple FilePond instances on a page, or if you have named the FilePond input something other than "filepond".

If this seems way too long, maybe even just Couldn't find the name of the input field in the request data


I opened this issue because this error message confused me for a long time before I was able to figure out what was going wrong. I know this is documented, but a better error message would still help save a considerable amount of time (and also give the developer a clue as to where to look to solve this issue).

GHA issues with older versions of Python

In the updated test configuration using tox and running across multiple Python versions, the attempt to run on Python 2.7, 3.5 and 3.6 fails. This seems to be because, when using ubuntu-latest for the OS, we're getting 22.04 runners which don't have these older versions of Python available.

This seems to be a common issue discussed in issue 544 of the setup-python repo. One temporary workaround seems to be to switch the version of Ubuntu being used to 20.04. This is an option but ideally, it would be good to be running on 22.04 where possible.

There are a couple of options here, one is simply to switch, for now to 20.04. The other is to update the GHA matrix to something similar to the example shown in https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#matrix-testing.

Here we could put an exclude on 20.04 for the newer versions and an exclude on 22.04 for the older versions. This may be a little messy to maintain but, for now, while the older Python versions are being supported, it may be more sustainable.

Template Tags for easy front end implementation

perhaps it's out of the scope of this project, but it'd be convenient to have some template tags baked in and maybe even a specific version of filepond. I can picture some kind of ModelForm integration as well where I am able to declare a form as a DRFFilepondForm or something.

save image to ImageField

Hi
I use FilePond Vue.js + django-drf-firepond. I want to save images in ImageField. I am sending a request with upload_id via axios. But nothing works. How to implement it?
Here is part of the code views.py.
Thank You

@api_view(['PATCH'])
def change_instance(request, instanceID):
        instance = generics.get_object_or_404(Instance, id=instanceID)
        avatar_uploudID = request.data.get('avatar')

        if avatar_uploudID and avatar_uploudID != None:
            try:
                tu = TemporaryUpload.objects.get(upload_id=avatar_uploudID)
            except TemporaryUpload.DoesNotExist:
                raise Response("The specified file does not exist.", status=status.HTTP_404_NOT_FOUND
            avatar_path = 'user_{0}/'.format(request.user.id)+tu.upload_name
            su = store_upload(avatar_uploudID,avatar_path)
            my_avatar_image= open(os.path.join(settings.MEDIA_ROOT,avatar_path))
            myfile = File(my_avatar_image)
            request.data['avatar'] = myfile

        serializer =InstanceSerializer(instance,data=request.data, partial=True)

    if serializer.is_valid():
        serializer.save()
        return Response(serializer.data, status=status.HTTP_200_OK)

    return Response(serializer._errors, status=status.HTTP_400_BAD_REQUEST)

Should StoredUpload use a base FileSystemStorage object based on FILE_STORE_PATH?

The update merged in #30 and discussed in #29 replaces the string used to specify the location of a stored upload with a FileField object.

At present there is no specific FileSystemStorage object set for this FileField so it's using the default storage object.

Since users of the library will set DJANGO_DRF_FILEPOND_FILE_STORE_PATH in their application settings to define the base location of the file store for stored uploads, having a FileSystemStorage object relative to this location should enforce that uploads are stored below this location and may be beneficial from a security perspective?

@pasvein, I'm fixing the tests to take account of the changes to the StoredUpload model and adding in this alteration. I'll raise a PR just for this fix initially and it would be great if you can check that this doesn't cause any issues for your use case.

Thanks.

VueJS - {"detail": "Invalid request data has been provided."}

Hello!

I was trying to set up vue-filepond with DRF and I keep getting this message after uploading photo on front end and on POSTMAN. I went through the tutorial on the page, I set up server options on Django and on Vue.

Is there any way of tracing the error better / making it more verbose?
Is there any collection of POSTMAN requests for a simple server setup?

Thank you for any suggestions.

'utf-8' codec can't decode byte 0xff in position 0: invalid start byte.

I've updated to Django 3.0.3 and django-storages 1.9.1 and boto3 1.12.0.

Not sure what triggered this error:

DjangoUnicodeDecodeError at /fp/load/
'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

But I fixed it by changing:

        with storage_backend.open(file_path, 'r') as remote_file:
            bytes_io = BytesIO(remote_file.read())

to:

        with storage_backend.open(file_path, 'rb') as remote_file:
            bytes_io = BytesIO(remote_file.read())

Missing migration

Please can we add the missing migration for this package:

└─[16:45]$ ./manage.py makemigrations
Raven is not configured (logging is disabled). Please see the documentation for more information.
Migrations for 'django_drf_filepond':
  /private/var/envs/samaritansselfhelp/lib/python3.7/site-packages/django_drf_filepond/migrations/0004_auto_20190802_1645.py
    - Alter field file on temporaryupload
    - Alter field file_id on temporaryupload

Accessing file url

I'm back :) Happy New Year!

I'm almost finished with integrating this library into my project.
One last thing which I'm confused about is how do I access the url of the StoredUpload.

I can see that TemporaryUpload has a file = models.FileField, but StoredUpload has only file_path = models.CharField. This means I can't access obj.file_path.url.

Am I missing something? Or is this a bug?

Cheers

Feature request: Add support for chunkUploads

Thanks for making django-drf-filepond!

When I try to enable chunkUploads in the filepond client, the process view in django-drf-filepond raises an exception like this:

Internal Server Error: /fp/process/
Traceback (most recent call last):
  File "C:\Users\Iver\Anaconda3\envs\my_project\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\Users\Iver\Anaconda3\envs\my_project\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "C:\Users\Iver\Anaconda3\envs\my_project\lib\site-packages\django\core\handlers\base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\Iver\Anaconda3\envs\my_project\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "C:\Users\Iver\Anaconda3\envs\my_project\lib\site-packages\django\views\generic\base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "C:\Users\Iver\Anaconda3\envs\my_project\lib\site-packages\rest_framework\views.py", line 505, in dispatch
    response = self.handle_exception(exc)
  File "C:\Users\Iver\Anaconda3\envs\my_project\lib\site-packages\rest_framework\views.py", line 465, in handle_exception
    self.raise_uncaught_exception(exc)
  File "C:\Users\Iver\Anaconda3\envs\my_project\lib\site-packages\rest_framework\views.py", line 476, in raise_uncaught_exception
    raise exc
  File "C:\Users\Iver\Anaconda3\envs\my_project\lib\site-packages\rest_framework\views.py", line 502, in dispatch
    response = handler(request, *args, **kwargs)
  File "C:\Users\Iver\Anaconda3\envs\my_project\lib\site-packages\django_drf_filepond\views.py", line 130, in post
    upload_filename = file_obj.name
AttributeError: 'str' object has no attribute 'name'

This made me realize that django-drf-filepond currently does not support chunked uploads. Here is a description of how filepond treats chunked uploads (the initial POST request does not include a file):

https://pqina.nl/filepond/docs/patterns/api/server/#process-chunks

Are there any plans for adding support for chunked uploads in django-drf-filepond?

Forbidden: /fp/process/ - "POST /fp/process/ HTTP/1.1" 403 59

Hi.
I have a problem with uploading files. I use docker.
I keep getting a bug:

Forbidden: /fp/process/
 "POST /fp/process/ HTTP/1.1" 403 59

My filepond js config

<script>
$(function () {
    $('.course_create_pond').filepond();
    $('.course_create_pond').filepond('allowMultiple', false);
    $('.course_create_pond').filepond.setOptions({
        chunkUploads: true,
        chunkSize: 50000,
        server: {
            url: 'http://localhost:8000/fp',
            process: '/process/',
            patch: '/patch/',
            revert: '/revert/',
            fetch: '/fetch/?target=',
        }
    });
});
</script>

urls.py

path('fp/', include('django_drf_filepond.urls')),

settings.py

if DEBUG:
    DJANGO_DRF_FILEPOND_UPLOAD_TMP = os.path.join(BASE_DIR, 'filepond-temp-uploads')
    DJANGO_DRF_FILEPOND_FILE_STORE_PATH = os.path.join(BASE_DIR, 'stored_uploads')
else:
    DJANGO_DRF_FILEPOND_STORAGES_BACKEND = 'storages.backends.s3boto3.S3Boto3Storage'

Setting for less restrictive file permissions

This has become an impediment in development for me. It would be nice to be able to have open file permissions as an django setting.

Also I am having trouble figuring out what 'mode' even is in os.mkdirs().

Problem with Pathlib based paths

Hello and thanks a lot for this awesome app. it makes lives so much easier!
I recently started a new django project (Django 3.1) and as you know, django has moved from os.path to Pathlib. unfortunately, this breaks this app's functionality.
It throws an error in :
django_drf_filepond/views.py, line 107
where it contains the following:
if ((not (storage.location).startswith(local_settings.BASE_DIR)) and (local_settings.BASE_DIR != os.path.dirname(django_drf_filepond.__file__))):

The error reads TypeError: startswith first arg must be str or a tuple of str, not WindowsPath, and everything works when I wrap storage.location in an str function (obviously, because startswhth expects strings.)

anyways, please forgive any mistakes I made, I am a newbie both in django and around github.

Support for using a custom storage for temporary uploads

Saving temporary uploads in the server's filesystem assumes there is a single Django instance serving all requests.

This poses problems in a production environment with multiple webserver instances with ephemeral storage (think containers in a Kubernetes environment).

Using a remote storage (i.e S3) supported by django-stroages for saving temporary uploads would solve this issue.

Could not delete temporary directory - NFS Disk

Sentry Log

OSError: [Errno 39] Directory not empty: '/kode/picxy/phtgr_photos/temporary_uploads/3k3VsojXz3kZwKVdcnvi9M'
  File "scheduler/tasks.py", line 238, in removeTemporaryUpload
    photo.temporary_upload.delete()
  File "django/db/models/base.py", line 919, in delete
    return collector.delete()
  File "django/db/models/deletion.py", line 318, in delete
    sender=model, instance=obj, using=self.using
  File "django/dispatch/dispatcher.py", line 175, in send
    for receiver in self._live_receivers(sender)
  File "django/dispatch/dispatcher.py", line 175, in <listcomp>
    for receiver in self._live_receivers(sender)
  File "django_drf_filepond/models.py", line 63, in delete_temp_upload_file
    os.rmdir(file_dir)

I've been using this plugin more than a year.. works like charm with local disk.
Recently, I have moved the deployment to kubernetes pod with NFS disk mounted to store the temporary uploads, where i am getting the error [os error: Directory not empty]

Folder that unable to delete 3k3VsojXz3kZwKVdcnvi9M it is emptly.

ls -lrt
total 0

ls -la
total 1568
drwxr-xr-x    2 root root    4096 Nov 16 09:24 .
drwxr-xr-x 4290 root root 1597440 Nov 16 10:06 ..

I don't think delete_temp_upload_file is a good Idea

First of all, Great library. It saved me from writing a filepond server but I have a problem with how it works.

Going through the code, I saw that there's a signal called delete_temp_upload_file that deletes the Temporary directory whenever an file is deleted.
I don't think this is a good Idea because It seems wastefu.

There's no point deleting the directory, when the next file upload will recreate it.
When there's a lot of concurrent image requests and you have multiple processes/threads deleting and recreating the directory, The OS has to do a lot of work to keep everything in sync which could cause degraded performance (and possibly corrupt data?)

I suggest that you disable this behaviour by default and make it optional. .delete should only delete the temporary files not the temporary directory.
Developers can easily write a cron or celery task to clean the temporary directory periodically.

In my case, there's no need to call .delete because I use Docker.
The temporary directory is cleared everytime I restart the container.

StoredUpload should be hotswappable

Currently working on a project where I want StoredUpload to have some extra data attached to it and there currently isn't a way to define my own model for the library to use. Is that something on the roadmap/useful for others?

Periodically clean up old temporary uploads

Would be awesome to have this library integrate with Celery to clean up from time to time the stale files in temporary upload folder and from database.

Thanks for your work! I'm almost done with integrating this library in my project :)

django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

Using the first option throws

django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

Full Trace

Traceback (most recent call last):
  File "./manage.py", line 16, in <module>
    execute_from_command_line(sys.argv)
  File "/User/aaa/.pyenv/versions/py3.7-clop/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/User/aaa/.pyenv/versions/py3.7-clop/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
    django.setup()
  File "/User/aaa/.pyenv/versions/py3.7-clop/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/User/aaa/.pyenv/versions/py3.7-clop/lib/python3.7/site-packages/django/apps/registry.py", line 89, in populate
    app_config = AppConfig.create(entry)
  File "/User/aaa/.pyenv/versions/py3.7-clop/lib/python3.7/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/User/aaa/.pyenv/versions/py3.7-clop/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/User/aaa/Sites/Projects/django-apps/py3.7-clop/backend/app/project/common/apps.py", line 7, in <module>
    from project.common.utils import AppGroupPermissions, AuthGroups, Permissions
  File "/User/aaa/Sites/Projects/django-apps/py3.7-clop/backend/app/project/common/utils/__init__.py", line 6, in <module>
    from ._file_upload import *  # noqa
  File "/User/aaa/Sites/Projects/django-apps/py3.7-clop/backend/app/project/common/utils/_file_upload.py", line 4, in <module>
    from django_drf_filepond.models import TemporaryUpload
  File "/User/aaa/.pyenv/versions/py3.7-clop/lib/python3.7/site-packages/django_drf_filepond/models.py", line 27, in <module>
    class TemporaryUpload(models.Model):
  File "/User/aaa/.pyenv/versions/py3.7-clop/lib/python3.7/site-packages/django/db/models/base.py", line 87, in __new__
    app_config = apps.get_containing_app_config(module)
  File "/User/aaa/.pyenv/versions/py3.7-clop/lib/python3.7/site-packages/django/apps/registry.py", line 249, in get_containing_app_config
    self.check_apps_ready()
  File "/User/aaa/.pyenv/versions/py3.7-clop/lib/python3.7/site-packages/django/apps/registry.py", line 132, in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

Bug: Error when using custom the user model

The models.py have two locations where the foreign key to users are defined by auth.User, if the project is using the custom user model, the following errors will be given:

ERRORS:
django_drf_filepond.StoredUpload.uploaded_by: (fields.E301) Field defines a relation with the model 'auth.User', which has been swapped out.
	HINT: Update the relation to point at 'settings.AUTH_USER_MODEL'.
django_drf_filepond.TemporaryUpload.uploaded_by: (fields.E301) Field defines a relation with the model 'auth.User', which has been swapped out.
	HINT: Update the relation to point at 'settings.AUTH_USER_MODEL'.

Using settings.AUTH_USER_MODEL solved the problem and according to the documentation, AUTH_USER_MODEL by default gives auth.User.

Problem while executing python setup.py test

As per #25

I have the problem trying to execute setup.py with test.
I have no experience with this kind of issue, maybe you can pin point where's the culprit.

My setup:

MacOS Catalina
Python 3.6

The massive log:

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
  warnings.warn(msg)
running test
Searching for paramiko
Best match: paramiko 2.7.1
Processing paramiko-2.7.1-py3.6.egg

Using /Users/pasevin/_Dev/_Repos/django-drf-filepond/.eggs/paramiko-2.7.1-py3.6.egg
Searching for httpretty
Reading https://pypi.python.org/simple/httpretty/
Downloading https://files.pythonhosted.org/packages/50/d1/e5e2da5c332b369f05b474e70ea7dcfa3cdaf7e11350bdae5e36a96e482f/httpretty-0.9.7.tar.gz#sha256=66216f26b9d2c52e81808f3e674a6fb65d4bf719721394a1a9be926177e55fbe
Best match: httpretty 0.9.7
Processing httpretty-0.9.7.tar.gz
Writing /var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-lnwk_p6c/httpretty-0.9.7/setup.cfg
Running httpretty-0.9.7/setup.py -q bdist_egg --dist-dir /var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-lnwk_p6c/httpretty-0.9.7/egg-dist-tmp-o5ia7c1b
creating /Users/pasevin/_Dev/_Repos/django-drf-filepond/.eggs/httpretty-0.9.7-py3.6.egg
Extracting httpretty-0.9.7-py3.6.egg to /Users/pasevin/_Dev/_Repos/django-drf-filepond/.eggs

Installed /Users/pasevin/_Dev/_Repos/django-drf-filepond/.eggs/httpretty-0.9.7-py3.6.egg
Searching for coverage
Best match: coverage 5.0
Processing coverage-5.0-py3.6-macosx-10.6-intel.egg

Using /Users/pasevin/_Dev/_Repos/django-drf-filepond/.eggs/coverage-5.0-py3.6-macosx-10.6-intel.egg
Searching for nose
Best match: nose 1.3.7
Processing nose-1.3.7-py3.6.egg

Using /Users/pasevin/_Dev/_Repos/django-drf-filepond/.eggs/nose-1.3.7-py3.6.egg
Searching for pynacl>=1.0.1
Reading https://pypi.python.org/simple/pynacl/
Downloading https://files.pythonhosted.org/packages/61/ab/2ac6dea8489fa713e2b4c6c5b549cc962dd4a842b5998d9e80cf8440b7cd/PyNaCl-1.3.0.tar.gz#sha256=0c6100edd16fefd1557da078c7a31e7b7d7a52ce39fdca2bec29d4f7b6e7600c
Best match: PyNaCl 1.3.0
Processing PyNaCl-1.3.0.tar.gz
Writing /var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/setup.cfg
Running PyNaCl-1.3.0/setup.py -q bdist_egg --dist-dir /var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/egg-dist-tmp-jtt9rmbc
_configtest.c:1:1: error: thread-local storage is not supported for the current target
__thread int some_threadlocal_variable_42;
^
1 error generated.
Note: will not use '__thread' in the C code
***** The above error message can be safely ignored.

ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /usr/local/Cellar/libffi/3.2.1/lib/libffi.dylib, building for macOS-i386 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd

Installed /private/var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/.eggs/cffi-1.13.2-py3.6-macosx-10.6-intel.egg
Searching for pycparser
Reading https://pypi.python.org/simple/pycparser/
Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz#sha256=a988718abfad80b6b157acce7bf130a30876d27603738ac39f140993246b25b3
Best match: pycparser 2.19
Processing pycparser-2.19.tar.gz
Writing /var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/temp/easy_install-8l5kjn_p/pycparser-2.19/setup.cfg
Running pycparser-2.19/setup.py -q bdist_egg --dist-dir /var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/temp/easy_install-8l5kjn_p/pycparser-2.19/egg-dist-tmp-z13ei75a
warning: no previously-included files found matching 'setup.pyc'
warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
warning: no previously-included files matching 'lextab.*' found under directory 'tests'
warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
warning: no previously-included files matching 'lextab.*' found under directory 'examples'
zip_safe flag not set; analyzing archive contents...
pycparser.ply.__pycache__.yacc.cpython-36: module references __file__
pycparser.ply.__pycache__.yacc.cpython-36: module MAY be using inspect.getsourcefile
pycparser.ply.__pycache__.yacc.cpython-36: module MAY be using inspect.stack
pycparser.ply.__pycache__.lex.cpython-36: module references __file__
pycparser.ply.__pycache__.lex.cpython-36: module MAY be using inspect.getsourcefile
pycparser.ply.__pycache__.ygen.cpython-36: module references __file__
creating /private/var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/.eggs/pycparser-2.19-py3.6.egg
Extracting pycparser-2.19-py3.6.egg to /private/var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/.eggs

Installed /private/var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/.eggs/pycparser-2.19-py3.6.egg
warning: no previously-included files matching '__pycache__/*' found anywhere in distribution
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching '.travis'
warning: no previously-included files found matching '.travis/install.sh'
warning: no previously-included files found matching '.travis/run.sh'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files found matching 'tasks.py'
warning: no previously-included files found matching 'Jenkinsfile'
warning: no previously-included files found matching '.jenkins'
warning: no previously-included files found matching '.jenkins/Jenkinsfile-pynacl-wheel-builder'
checking build system type... x86_64-apple-darwin19.0.0
checking host system type... x86_64-apple-darwin19.0.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /private/var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/src/libsodium/build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '501' is supported by ustar format... yes
checking whether GID '20' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... none
checking for a sed that does not truncate output... /usr/bin/sed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether gcc is Clang... yes
checking whether Clang needs flag to prevent "argument unused" warning when linking with -pthread... no
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking for gcc option to accept ISO C99... none needed
checking dependency style of gcc... none
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for variable-length arrays... yes
checking for __native_client__ defined... no
checking for _FORTIFY_SOURCE defined... no
checking whether C compiler accepts -D_FORTIFY_SOURCE=2... yes
checking whether C compiler accepts -fvisibility=hidden... yes
checking whether C compiler accepts -fPIC... yes
checking whether C compiler accepts -fPIE... yes
checking whether the linker accepts -pie... yes
checking whether C compiler accepts -fno-strict-aliasing... yes
checking whether C compiler accepts -fno-strict-overflow... yes
checking whether C compiler accepts -fstack-protector... yes
checking whether the linker accepts -fstack-protector... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wall... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra... yes
checking for clang... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits -Wno-unknown-pragmas... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits -Wno-unknown-pragmas -Wnormalized=id... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits -Wno-unknown-pragmas -Wnormalized=id -Wnull-dereference... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits -Wno-unknown-pragmas -Wnormalized=id -Wnull-dereference -Wold-style-declaration... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits -Wno-unknown-pragmas -Wnormalized=id -Wnull-dereference -Wold-style-declaration -Wpointer-arith... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits -Wno-unknown-pragmas -Wnormalized=id -Wnull-dereference -Wold-style-declaration -Wpointer-arith -Wredundant-decls... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits -Wno-unknown-pragmas -Wnormalized=id -Wnull-dereference -Wold-style-declaration -Wpointer-arith -Wredundant-decls -Wrestrict... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits -Wno-unknown-pragmas -Wnormalized=id -Wnull-dereference -Wold-style-declaration -Wpointer-arith -Wredundant-decls -Wrestrict -Wshorten-64-to-32... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits -Wno-unknown-pragmas -Wnormalized=id -Wnull-dereference -Wold-style-declaration -Wpointer-arith -Wredundant-decls -Wrestrict -Wshorten-64-to-32 -Wsometimes-uninitialized... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits -Wno-unknown-pragmas -Wnormalized=id -Wnull-dereference -Wold-style-declaration -Wpointer-arith -Wredundant-decls -Wrestrict -Wshorten-64-to-32 -Wsometimes-uninitialized -Wstrict-prototypes... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits -Wno-unknown-pragmas -Wnormalized=id -Wnull-dereference -Wold-style-declaration -Wpointer-arith -Wredundant-decls -Wrestrict -Wshorten-64-to-32 -Wsometimes-uninitialized -Wstrict-prototypes -Wswitch-enum... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits -Wno-unknown-pragmas -Wnormalized=id -Wnull-dereference -Wold-style-declaration -Wpointer-arith -Wredundant-decls -Wrestrict -Wshorten-64-to-32 -Wsometimes-uninitialized -Wstrict-prototypes -Wswitch-enum -Wvariable-decl... yes
checking whether C compiler accepts -g -O2 -pthread -fvisibility=hidden -fPIC -fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector -Wextra -Wno-unknown-warning-option -Wbad-function-cast -Wcast-qual -Wdiv-by-zero -Wduplicated-branches -Wduplicated-cond -Wfloat-equal -Wformat=2 -Wlogical-op -Wmaybe-uninitialized -Wmisleading-indentation -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-type-limits -Wno-unknown-pragmas -Wnormalized=id -Wnull-dereference -Wold-style-declaration -Wpointer-arith -Wredundant-decls -Wrestrict -Wshorten-64-to-32 -Wsometimes-uninitialized -Wstrict-prototypes -Wswitch-enum -Wvariable-decl -Wwrite-strings... yes
checking whether the linker accepts -Wl,-z,relro... no
checking whether the linker accepts -Wl,-z,now... no
checking whether the linker accepts -Wl,-z,noexecstack... no
checking for a broken clang + AVX512 combination... no
checking whether segmentation violations can be caught when using the C compiler... yes
checking whether SIGABRT can be caught when using the C compiler... yes
checking for thread local storage (TLS) class... _Thread_local
thread local storage is supported
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin19.0.0 file names to x86_64-apple-darwin19.0.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin19.0.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin19.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for ar... (cached) ar
checking whether C compiler accepts -mmmx... yes
checking for MMX instructions set... yes
checking whether C compiler accepts -mmmx... (cached) yes
checking whether C compiler accepts -msse2... yes
checking for SSE2 instructions set... yes
checking whether C compiler accepts -msse2... (cached) yes
checking whether C compiler accepts -msse3... yes
checking for SSE3 instructions set... yes
checking whether C compiler accepts -msse3... (cached) yes
checking whether C compiler accepts -mssse3... yes
checking for SSSE3 instructions set... yes
checking whether C compiler accepts -mssse3... (cached) yes
checking whether C compiler accepts -msse4.1... yes
checking for SSE4.1 instructions set... yes
checking whether C compiler accepts -msse4.1... (cached) yes
checking whether C compiler accepts -mavx... yes
checking for AVX instructions set... yes
checking whether C compiler accepts -mavx... (cached) yes
checking whether C compiler accepts -mavx2... yes
checking for AVX2 instructions set... yes
checking whether C compiler accepts -mavx2... (cached) yes
checking if _mm256_broadcastsi128_si256 is correctly defined... yes
checking whether C compiler accepts -mavx512f... yes
checking for AVX512F instructions set... yes
checking whether C compiler accepts -mavx512f... (cached) yes
checking whether C compiler accepts -maes... yes
checking whether C compiler accepts -mpclmul... yes
checking for AESNI instructions set and PCLMULQDQ... yes
checking whether C compiler accepts -maes... (cached) yes
checking whether C compiler accepts -mpclmul... (cached) yes
checking whether C compiler accepts -mrdrnd... yes
checking for RDRAND... yes
checking whether C compiler accepts -mrdrnd... (cached) yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking intrin.h usability... no
checking intrin.h presence... no
checking for intrin.h... no
checking if _xgetbv() is available... no
checking for inline... inline
checking whether byte ordering is bigendian... (cached) no
checking whether __STDC_LIMIT_MACROS is required... no
checking whether we can use x86_64 asm code... yes
checking whether we can assemble AVX opcodes... yes
checking for 128-bit arithmetic... yes
checking for cpuid instruction... yes
checking if the .private_extern asm directive is supported... yes
checking if the .hidden asm directive is supported... no
checking if weak symbols are supported... yes
checking if data alignment is required... no
checking if atomic operations are supported... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for arc4random... yes
checking for arc4random_buf... yes
checking for mmap... yes
checking for mlock... yes
checking for madvise... yes
checking for mprotect... yes
checking for memset_s... yes
checking for explicit_bzero... no
checking for nanosleep... yes
checking for posix_memalign... yes
checking for getpid... yes
checking if gcc/ld supports -Wl,--output-def... not needed, shared libraries are disabled
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating builds/Makefile
config.status: creating contrib/Makefile
config.status: creating dist-build/Makefile
config.status: creating libsodium.pc
config.status: creating libsodium-uninstalled.pc
config.status: creating msvc-scripts/Makefile
config.status: creating src/Makefile
config.status: creating src/libsodium/Makefile
config.status: creating src/libsodium/include/Makefile
config.status: creating src/libsodium/include/sodium/version.h
config.status: creating test/default/Makefile
config.status: creating test/Makefile
config.status: executing depfiles commands
config.status: executing libtool commands
Making all in builds
make[1]: Nothing to be done for `all'.
Making all in contrib
make[1]: Nothing to be done for `all'.
Making all in dist-build
make[1]: Nothing to be done for `all'.
Making all in msvc-scripts
make[1]: Nothing to be done for `all'.
Making all in src
Making all in libsodium
Making all in include
make[3]: Nothing to be done for `all'.
  CC       crypto_aead/chacha20poly1305/sodium/libsodium_la-aead_chacha20poly1305.lo
  CC       crypto_aead/xchacha20poly1305/sodium/libsodium_la-aead_xchacha20poly1305.lo
  CC       crypto_auth/libsodium_la-crypto_auth.lo
  CC       crypto_auth/hmacsha256/libsodium_la-auth_hmacsha256.lo
  CC       crypto_auth/hmacsha512/libsodium_la-auth_hmacsha512.lo
  CC       crypto_auth/hmacsha512256/libsodium_la-auth_hmacsha512256.lo
  CC       crypto_box/libsodium_la-crypto_box.lo
  CC       crypto_box/libsodium_la-crypto_box_easy.lo
  CC       crypto_box/libsodium_la-crypto_box_seal.lo
  CC       crypto_box/curve25519xsalsa20poly1305/libsodium_la-box_curve25519xsalsa20poly1305.lo
  CC       crypto_core/ed25519/ref10/libsodium_la-ed25519_ref10.lo
  CC       crypto_core/hchacha20/libsodium_la-core_hchacha20.lo
  CC       crypto_core/hsalsa20/ref2/libsodium_la-core_hsalsa20_ref2.lo
  CC       crypto_core/hsalsa20/libsodium_la-core_hsalsa20.lo
  CC       crypto_core/salsa/ref/libsodium_la-core_salsa_ref.lo
  CC       crypto_generichash/libsodium_la-crypto_generichash.lo
  CC       crypto_generichash/blake2b/libsodium_la-generichash_blake2.lo
  CC       crypto_generichash/blake2b/ref/libsodium_la-blake2b-compress-ref.lo
  CC       crypto_generichash/blake2b/ref/libsodium_la-blake2b-ref.lo
  CC       crypto_generichash/blake2b/ref/libsodium_la-generichash_blake2b.lo
  CC       crypto_hash/libsodium_la-crypto_hash.lo
  CC       crypto_hash/sha256/libsodium_la-hash_sha256.lo
  CC       crypto_hash/sha256/cp/libsodium_la-hash_sha256_cp.lo
  CC       crypto_hash/sha512/libsodium_la-hash_sha512.lo
  CC       crypto_hash/sha512/cp/libsodium_la-hash_sha512_cp.lo
  CC       crypto_kdf/blake2b/libsodium_la-kdf_blake2b.lo
  CC       crypto_kdf/libsodium_la-crypto_kdf.lo
  CC       crypto_kx/libsodium_la-crypto_kx.lo
  CC       crypto_onetimeauth/libsodium_la-crypto_onetimeauth.lo
  CC       crypto_onetimeauth/poly1305/libsodium_la-onetimeauth_poly1305.lo
  CC       crypto_onetimeauth/poly1305/donna/libsodium_la-poly1305_donna.lo
  CC       crypto_pwhash/argon2/libsodium_la-argon2-core.lo
  CC       crypto_pwhash/argon2/libsodium_la-argon2-encoding.lo
  CC       crypto_pwhash/argon2/libsodium_la-argon2-fill-block-ref.lo
  CC       crypto_pwhash/argon2/libsodium_la-argon2.lo
  CC       crypto_pwhash/argon2/libsodium_la-blake2b-long.lo
  CC       crypto_pwhash/argon2/libsodium_la-pwhash_argon2i.lo
  CC       crypto_pwhash/argon2/libsodium_la-pwhash_argon2id.lo
  CC       crypto_pwhash/libsodium_la-crypto_pwhash.lo
  CC       crypto_scalarmult/libsodium_la-crypto_scalarmult.lo
  CC       crypto_scalarmult/curve25519/ref10/libsodium_la-x25519_ref10.lo
  CC       crypto_scalarmult/curve25519/libsodium_la-scalarmult_curve25519.lo
  CC       crypto_secretbox/libsodium_la-crypto_secretbox.lo
  CC       crypto_secretbox/libsodium_la-crypto_secretbox_easy.lo
  CC       crypto_secretbox/xsalsa20poly1305/libsodium_la-secretbox_xsalsa20poly1305.lo
  CC       crypto_secretstream/xchacha20poly1305/libsodium_la-secretstream_xchacha20poly1305.lo
  CC       crypto_shorthash/libsodium_la-crypto_shorthash.lo
  CC       crypto_shorthash/siphash24/libsodium_la-shorthash_siphash24.lo
  CC       crypto_shorthash/siphash24/ref/libsodium_la-shorthash_siphash24_ref.lo
  CC       crypto_sign/libsodium_la-crypto_sign.lo
  CC       crypto_sign/ed25519/libsodium_la-sign_ed25519.lo
  CC       crypto_sign/ed25519/ref10/libsodium_la-keypair.lo
  CC       crypto_sign/ed25519/ref10/libsodium_la-open.lo
  CC       crypto_sign/ed25519/ref10/libsodium_la-sign.lo
  CC       crypto_stream/chacha20/libsodium_la-stream_chacha20.lo
  CC       crypto_stream/chacha20/ref/libsodium_la-chacha20_ref.lo
  CC       crypto_stream/libsodium_la-crypto_stream.lo
  CC       crypto_stream/salsa20/libsodium_la-stream_salsa20.lo
  CC       crypto_stream/xsalsa20/libsodium_la-stream_xsalsa20.lo
  CC       crypto_verify/sodium/libsodium_la-verify.lo
  CC       randombytes/libsodium_la-randombytes.lo
  CC       sodium/libsodium_la-codecs.lo
  CC       sodium/libsodium_la-core.lo
  CC       sodium/libsodium_la-runtime.lo
  CC       sodium/libsodium_la-utils.lo
  CC       sodium/libsodium_la-version.lo
  CPPAS    crypto_stream/salsa20/xmm6/libsodium_la-salsa20_xmm6-asm.lo
  CC       crypto_stream/salsa20/xmm6/libsodium_la-salsa20_xmm6.lo
  CC       crypto_scalarmult/curve25519/sandy2x/libsodium_la-curve25519_sandy2x.lo
  CC       crypto_scalarmult/curve25519/sandy2x/libsodium_la-fe51_invert.lo
  CC       crypto_scalarmult/curve25519/sandy2x/libsodium_la-fe_frombytes_sandy2x.lo
  CPPAS    crypto_scalarmult/curve25519/sandy2x/libsodium_la-sandy2x.lo
  CC       crypto_box/curve25519xchacha20poly1305/libsodium_la-box_curve25519xchacha20poly1305.lo
  CC       crypto_box/curve25519xchacha20poly1305/libsodium_la-box_seal_curve25519xchacha20poly1305.lo
  CC       crypto_core/ed25519/libsodium_la-core_ed25519.lo
  CC       crypto_pwhash/scryptsalsa208sha256/libsodium_la-crypto_scrypt-common.lo
  CC       crypto_pwhash/scryptsalsa208sha256/libsodium_la-scrypt_platform.lo
  CC       crypto_pwhash/scryptsalsa208sha256/libsodium_la-pbkdf2-sha256.lo
  CC       crypto_pwhash/scryptsalsa208sha256/libsodium_la-pwhash_scryptsalsa208sha256.lo
  CC       crypto_pwhash/scryptsalsa208sha256/nosse/libsodium_la-pwhash_scryptsalsa208sha256_nosse.lo
  CC       crypto_scalarmult/ed25519/ref10/libsodium_la-scalarmult_ed25519_ref10.lo
  CC       crypto_secretbox/xchacha20poly1305/libsodium_la-secretbox_xchacha20poly1305.lo
  CC       crypto_shorthash/siphash24/libsodium_la-shorthash_siphashx24.lo
  CC       crypto_shorthash/siphash24/ref/libsodium_la-shorthash_siphashx24_ref.lo
  CC       crypto_sign/ed25519/ref10/libsodium_la-obsolete.lo
  CC       crypto_stream/salsa2012/ref/libsodium_la-stream_salsa2012_ref.lo
  CC       crypto_stream/salsa2012/libsodium_la-stream_salsa2012.lo
  CC       crypto_stream/salsa208/ref/libsodium_la-stream_salsa208_ref.lo
  CC       crypto_stream/salsa208/libsodium_la-stream_salsa208.lo
  CC       crypto_stream/xchacha20/libsodium_la-stream_xchacha20.lo
  CC       randombytes/sysrandom/libsodium_la-randombytes_sysrandom.lo
  CC       crypto_aead/aes256gcm/aesni/libaesni_la-aead_aes256gcm_aesni.lo
  CCLD     libaesni.la
libtool: warning: '-version-info/-version-number' is ignored for convenience libraries
  CC       crypto_onetimeauth/poly1305/sse2/libsse2_la-poly1305_sse2.lo
  CC       crypto_pwhash/scryptsalsa208sha256/sse/libsse2_la-pwhash_scryptsalsa208sha256_sse.lo
  CCLD     libsse2.la
libtool: warning: '-version-info/-version-number' is ignored for convenience libraries
  CC       crypto_generichash/blake2b/ref/libssse3_la-blake2b-compress-ssse3.lo
  CC       crypto_pwhash/argon2/libssse3_la-argon2-fill-block-ssse3.lo
  CC       crypto_stream/chacha20/dolbeau/libssse3_la-chacha20_dolbeau-ssse3.lo
  CCLD     libssse3.la
libtool: warning: '-version-info/-version-number' is ignored for convenience libraries
  CC       crypto_generichash/blake2b/ref/libsse41_la-blake2b-compress-sse41.lo
  CCLD     libsse41.la
libtool: warning: '-version-info/-version-number' is ignored for convenience libraries
  CC       crypto_generichash/blake2b/ref/libavx2_la-blake2b-compress-avx2.lo
  CC       crypto_pwhash/argon2/libavx2_la-argon2-fill-block-avx2.lo
  CC       crypto_stream/chacha20/dolbeau/libavx2_la-chacha20_dolbeau-avx2.lo
  CC       crypto_stream/salsa20/xmm6int/libavx2_la-salsa20_xmm6int-avx2.lo
  CCLD     libavx2.la
libtool: warning: '-version-info/-version-number' is ignored for convenience libraries
  CC       crypto_pwhash/argon2/libavx512f_la-argon2-fill-block-avx512f.lo
  CCLD     libavx512f.la
libtool: warning: '-version-info/-version-number' is ignored for convenience libraries
  CC       randombytes/salsa20/librdrand_la-randombytes_salsa20_random.lo
  CCLD     librdrand.la
libtool: warning: '-version-info/-version-number' is ignored for convenience libraries
  CCLD     libsodium.la
make[2]: Nothing to be done for `all-am'.
Making all in test
Making all in default
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all-am'.
make[1]: Nothing to be done for `all-am'.
Making check in builds
make[1]: Nothing to be done for `check'.
Making check in contrib
make[1]: Nothing to be done for `check'.
Making check in dist-build
make[1]: Nothing to be done for `check'.
Making check in msvc-scripts
make[1]: Nothing to be done for `check'.
Making check in src
Making check in libsodium
Making check in include
make[3]: Nothing to be done for `check'.
make[3]: Nothing to be done for `check-am'.
make[2]: Nothing to be done for `check-am'.
Making check in test
Making check in default
/Applications/Xcode.app/Contents/Developer/usr/bin/make  aead_aes256gcm aead_chacha20poly1305 aead_xchacha20poly1305 auth auth2 auth3 auth5 auth6 auth7 box box2 box7 box8 box_easy box_easy2 box_seal box_seed chacha20 codecs core1 core2 core3 core4 core5 core6 ed25519_convert generichash generichash2 generichash3 hash hash3 kdf keygen kx metamorphic misuse onetimeauth onetimeauth2 onetimeauth7 pwhash_argon2i pwhash_argon2id randombytes scalarmult scalarmult2 scalarmult5 scalarmult6 scalarmult7 secretbox secretbox2 secretbox7 secretbox8 secretbox_easy secretbox_easy2 secretstream shorthash sign sodium_core sodium_utils sodium_version stream stream2 stream3 stream4 verify1 sodium_utils2 sodium_utils3 core_ed25519 pwhash_scrypt pwhash_scrypt_ll scalarmult_ed25519 siphashx24 xchacha20
  CC       aead_aes256gcm.o
  CCLD     aead_aes256gcm
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       aead_chacha20poly1305.o
  CCLD     aead_chacha20poly1305
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       aead_xchacha20poly1305.o
  CCLD     aead_xchacha20poly1305
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       auth.o
  CCLD     auth
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       auth2.o
  CCLD     auth2
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       auth3.o
  CCLD     auth3
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       auth5.o
  CCLD     auth5
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       auth6.o
  CCLD     auth6
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       auth7.o
  CCLD     auth7
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       box.o
  CCLD     box
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       box2.o
  CCLD     box2
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       box7.o
  CCLD     box7
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       box8.o
  CCLD     box8
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       box_easy.o
  CCLD     box_easy
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       box_easy2.o
  CCLD     box_easy2
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       box_seal.o
  CCLD     box_seal
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       box_seed.o
  CCLD     box_seed
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       chacha20.o
  CCLD     chacha20
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       codecs.o
  CCLD     codecs
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       core1.o
  CCLD     core1
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       core2.o
  CCLD     core2
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       core3.o
  CCLD     core3
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       core4.o
  CCLD     core4
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       core5.o
  CCLD     core5
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       core6.o
  CCLD     core6
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       ed25519_convert.o
  CCLD     ed25519_convert
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       generichash.o
  CCLD     generichash
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       generichash2.o
  CCLD     generichash2
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       generichash3.o
  CCLD     generichash3
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       hash.o
  CCLD     hash
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       hash3.o
  CCLD     hash3
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       kdf.o
  CCLD     kdf
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       keygen.o
  CCLD     keygen
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       kx.o
  CCLD     kx
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       metamorphic.o
  CCLD     metamorphic
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       misuse.o
  CCLD     misuse
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       onetimeauth.o
  CCLD     onetimeauth
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       onetimeauth2.o
  CCLD     onetimeauth2
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       onetimeauth7.o
  CCLD     onetimeauth7
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       pwhash_argon2i.o
  CCLD     pwhash_argon2i
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       pwhash_argon2id.o
  CCLD     pwhash_argon2id
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       randombytes.o
  CCLD     randombytes
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       scalarmult.o
  CCLD     scalarmult
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       scalarmult2.o
  CCLD     scalarmult2
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       scalarmult5.o
  CCLD     scalarmult5
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       scalarmult6.o
  CCLD     scalarmult6
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       scalarmult7.o
  CCLD     scalarmult7
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       secretbox.o
  CCLD     secretbox
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       secretbox2.o
  CCLD     secretbox2
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       secretbox7.o
  CCLD     secretbox7
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       secretbox8.o
  CCLD     secretbox8
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       secretbox_easy.o
  CCLD     secretbox_easy
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       secretbox_easy2.o
  CCLD     secretbox_easy2
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       secretstream.o
  CCLD     secretstream
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       shorthash.o
  CCLD     shorthash
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       sign.o
  CCLD     sign
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       sodium_core.o
  CCLD     sodium_core
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       sodium_utils.o
  CCLD     sodium_utils
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       sodium_version.o
  CCLD     sodium_version
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       stream.o
  CCLD     stream
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       stream2.o
  CCLD     stream2
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       stream3.o
  CCLD     stream3
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       stream4.o
  CCLD     stream4
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       verify1.o
  CCLD     verify1
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       sodium_utils2.o
  CCLD     sodium_utils2
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       sodium_utils3.o
  CCLD     sodium_utils3
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       core_ed25519.o
  CCLD     core_ed25519
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       pwhash_scrypt.o
  CCLD     pwhash_scrypt
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       pwhash_scrypt_ll.o
  CCLD     pwhash_scrypt_ll
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       scalarmult_ed25519.o
  CCLD     scalarmult_ed25519
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       siphashx24.o
  CCLD     siphashx24
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
  CC       xchacha20.o
  CCLD     xchacha20
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
/Applications/Xcode.app/Contents/Developer/usr/bin/make  check-TESTS
PASS: aead_aes256gcm
PASS: aead_chacha20poly1305
PASS: aead_xchacha20poly1305
PASS: auth
PASS: auth2
PASS: auth3
PASS: auth5
PASS: auth6
PASS: auth7
PASS: box
PASS: box2
PASS: box7
PASS: box8
PASS: box_easy
PASS: box_easy2
PASS: box_seal
PASS: box_seed
PASS: chacha20
PASS: codecs
PASS: core1
PASS: core2
PASS: core3
PASS: core4
PASS: core5
PASS: core6
PASS: ed25519_convert
PASS: generichash
PASS: generichash2
PASS: generichash3
PASS: hash
PASS: hash3
PASS: kdf
PASS: keygen
PASS: kx
PASS: metamorphic
PASS: misuse
PASS: onetimeauth
PASS: onetimeauth2
PASS: onetimeauth7
/private/var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/src/libsodium/build-aux/test-driver: line 107: 50430 Segmentation fault: 11  "$@" > $log_file 2>&1
FAIL: pwhash_argon2i
/private/var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/src/libsodium/build-aux/test-driver: line 107: 50437 Segmentation fault: 11  "$@" > $log_file 2>&1
FAIL: pwhash_argon2id
PASS: randombytes
PASS: scalarmult
PASS: scalarmult2
PASS: scalarmult5
PASS: scalarmult6
PASS: scalarmult7
PASS: secretbox
PASS: secretbox2
PASS: secretbox7
PASS: secretbox8
PASS: secretbox_easy
PASS: secretbox_easy2
PASS: secretstream
PASS: shorthash
PASS: sign
PASS: sodium_core
PASS: sodium_utils
PASS: sodium_version
PASS: stream
PASS: stream2
PASS: stream3
PASS: stream4
PASS: verify1
PASS: sodium_utils2
PASS: sodium_utils3
PASS: core_ed25519
PASS: pwhash_scrypt
PASS: pwhash_scrypt_ll
PASS: scalarmult_ed25519
PASS: siphashx24
PASS: xchacha20
============================================================================
Testsuite summary for libsodium 1.0.16
============================================================================
# TOTAL: 72
# PASS:  70
# SKIP:  0
# XFAIL: 0
# FAIL:  2
# XPASS: 0
# ERROR: 0
============================================================================
See test/default/test-suite.log
Please report to https://github.com/jedisct1/libsodium/issues
============================================================================
make[4]: *** [test-suite.log] Error 1
make[3]: *** [check-TESTS] Error 2
make[2]: *** [check-am] Error 2
make[1]: *** [check-recursive] Error 1
make: *** [check-recursive] Error 1
Traceback (most recent call last):
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 157, in save_modules
    yield saved
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 198, in setup_context
    yield
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 248, in run_setup
    DirectorySandbox(setup_dir).run(runner)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 278, in run
    return func()
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 246, in runner
    _execfile(setup_script, ns)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 47, in _execfile
    exec(code, globals, locals)
  File "/var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/setup.py", line 255, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 160, in run
    self.run_command('build_clib')
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/setup.py", line 179, in run
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', 'check']' returned non-zero exit status 2.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 50, in <module>
    "Topic :: Software Development :: Libraries :: Python Modules",
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/command/test.py", line 198, in run
    installed_dists = self.install_dists(self.distribution)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/command/test.py", line 194, in install_dists
    tr_d = dist.fetch_build_eggs(dist.tests_require or [])
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/dist.py", line 361, in fetch_build_eggs
    replace_conflicting=True,
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 850, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1122, in best_match
    return self.obtain(req, installer)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1134, in obtain
    return installer(requirement)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/dist.py", line 429, in fetch_build_egg
    return cmd.easy_install(req)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 665, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 695, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 876, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1115, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1101, in run_setup
    run_setup(setup_script, args)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 251, in run_setup
    raise
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 100, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 198, in setup_context
    yield
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 100, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 169, in save_modules
    saved_exc.resume()
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 144, in resume
    six.reraise(type, exc, self._tb)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/pkg_resources/_vendor/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 157, in save_modules
    yield saved
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 198, in setup_context
    yield
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 248, in run_setup
    DirectorySandbox(setup_dir).run(runner)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 278, in run
    return func()
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 246, in runner
    _execfile(setup_script, ns)
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/sandbox.py", line 47, in _execfile
    exec(code, globals, locals)
  File "/var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/setup.py", line 255, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/Users/pasevin/_Dev/_Repos/django-drf-filepond/env/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 160, in run
    self.run_command('build_clib')
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/var/folders/5y/xlnjt7gs4cz1h4lch1sqft1c0000gn/T/easy_install-f6nf050k/PyNaCl-1.3.0/setup.py", line 179, in run
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', 'check']' returned non-zero exit status 2.

Ask about the implementation of the API load method

Hello, I'm using this component to change the profile picture of the user, and I'm encountering problems when initializing the component with the saved image, since the load method is not implemented and it is not clear to me that I return in the API to see the preview of the profile image previously saved.

Do you have any examples of the implementation of the load method? passing the upload_id of the TemporaryUpload model as a parameter

Thank you

image

add init files
image

DRF Authentication

Is it possible to prevent file uploads without access token?
Right now it looks like I can upload files without authenticating.
Looks like a potential vulnerability :)

Chunked uploads fail when upload file size is an exact multiple of chunk size

When handling a chunked upload, django-drf-filepond receives the size of the file upload that it expects and creates a temporary database object to track the upload of the file chunks.

Once all file chunks have been uploaded, the final file is created and saved and the TemporaryUploadChunked object is deleted.

However, when the filepond client is processing a chunked upload where the file is an exact multiple of the chunk size, it results in a final chunk of 0 size as a result of the calculation on this line in src/js/app/utils/processFileChunked.js.

With django-drf-filepond, the final PATCH request with an empty payload results in an attempt to handle a patch for a file that has been processed and saved because all data has been received. The TemporaryUploadChunked object associated with the request no longer exists so it fails.

The sample filepond-server-php server implementation doesn't have a problem with this since it seems to accept any PATCH request with any 'patch' ID and no content and return a 204 code.

The best way to resolve this with django-drf-filepond is probably going to be to check if the incoming patch request has an offset that is equal to the file length and a content length of 0. If so we simply accept the request and do nothing. As a further check, we could also verify that there is a completed temporary upload corresponding to the ID.

revert fails

Revert fails with

''dict' object has no attribute 'strip''

Multiple images

Hello,

I am using VueJS front-end plugin and DRF on backend. FE allows uploading drag-drop multiple images and I was thinking about expanding my 1 picture and making a gallery for a model.

Is it possible to save multiple images via DRF-filepond? I am using AWS

repository is vulnerable

A new security advisory was published

We found a vulnerable dependency in repositories you have security alert access to.

Security advisory GHSA-vfq6-hq5r-27r6 (moderate severity) affects 1 repository:

Django(pip) used in 1 repository

ImperialCollegeLondon/django-drf-filepond
View alert [https://github.com/ImperialCollegeLondon/django-drf-filepond/network/alert/setup.py/Django/open]

BASE_DIR error

Line 20 - 21 in this file (which is used for testing)

django_drf_filepond/drf_filepond_settings.py
UPLOAD_TMP = getattr(settings, _app_prefix+'UPLOAD_TMP',
                     os.path.join(settings.BASE_DIR,'filepond_uploads'))

requires BASE_DIR be set but my config is customized and I don't use that.

I don't think users should be forced to set the BASE_DIR if they do not need it.

Update for django 4

Django 4 removes django.conf.urls.url which was being used in the django-drf-filepond URL mappings.

This needs to be fixed by moving to django.urls.path or re_path. However, switching to these will remove compatibility with Python 2.7. Since Python 2.7 support is not yet officially deprecated, this should be done in v0.5.0 with a view to that being the last version providing py2.7 support.

This was fixed in #66 with python 2.7 support re-introduced with the updates in #67.

Add support for using custom StoredUpload models

Based on the discussion in issue #62, it looks like there would be a benefit in supporting custom StoredUpload models. This adds to an earlier request for this functionality raised in #45.

This would address the issue where there is a need to link mulitple stored uploads to some other model instance.

At present this could be done by modifying StoredUpload to add a ForeignKey to the required application model. This implements a one-to-many relationship using Django's reverse implementation approach where it is implemented as a many-to-one relationship adding the ForeignKey on the object that represents the "many" side of the relationship. Modifying StoredUpload is not an ideal or recommended solution since it makes maintenance more complicated and also creates a strong link to django-drf-filepond meaning that the library can't be easily upgraded to a new version without making custom modifications.

Creating an intermediate model that contains multiple instances linking a single application model instance to each required django-drf-filepond StoredUpload instance is an alternative option. This is effectively the same as using a ManyToManyField on the application model to link to multiple StoredUpload instances, although I suppose this would be considered bad practice since it is actually modelling a one-to-many relationship but using a many-to-many as a workaround to avoid having to modify StoredUpload.

To resolve these challenges, a better option would be to support the use of a custom StoredUpload model that extends django-drf-filepond's StoredUpload. A setting DJANGO_DRF_FILEPOND_STORED_UPLOAD_MODEL or similar would then allow the custom model to be permanently selected, or a custom_model attribute on the store_upload API call would allow specifying the model on a case-by-case basis. stored_upload would then accept a dictionary of additional keyword arguments representing additional data to store in the custom model instance.

How to make thumbnail for a stored_upload?

Hi
I want to use
from sorl.thumbnail import get_thumbnail

su = get_stored_upload(upload_id)

how to make & store thumnails for existing upload?
I need to do something so that they are done automatically when created and deleted when deleted
Thanks

Remove Python 2.7-specific code

django-drf-filepond v0.6.0 will be the first Python 3-only version of the library.

In preparation for the 0.6.0 release, Python 2.7-specific code should be removed to clean up the codebase.

Feature request: Add custom upload field name

Hi,

we are using this django module with FilePond on our website. The issue we have right now is that we have multiple FilePond instances on our side. And therefore we have mutliple upload file fields.

As I look into the code of this Django module, there is no support for this? The upload field name has to be filepond always. This is not flexible for us.

So we made a very small code change at https://github.com/ImperialCollegeLondon/django-drf-filepond/blob/master/django_drf_filepond/views.py#L62:

file_id = _get_file_id()
upload_id = _get_file_id()
        
if 'filepond' not in request.data:
    raise ParseError("Invalid request data has been provided.")
            
file_obj = request.data['filepond']

To:

file_id = _get_file_id()
upload_id = _get_file_id()

upload_field = 'filepond'
if 'fp_upload_field' in request.data:
    upload_field = request.data['fp_upload_field']

if upload_field not in request.data:
    raise ParseError("Invalid request data has been provided.")

file_obj = request.data[upload_field]

Then we extend the FilePond srver processing code with:

server: {
      url: '/fp',
      process: {
        url: '/process/',
        method: 'POST',
        headers: {
          'X-CSRFToken': $('input[name="csrfmiddlewaretoken"]').val()
        },
        withCredentials: false,
        ondata: (formData) => {
          var upload_field = '';
          for (var item of formData.keys()) {
            upload_field = item;
            break;
          }
          if (upload_field !== '') {
            formData.append('fp_upload_field',upload_field);
          }
          return formData;
        },
        onerror: (response) => { console.log(response.data); },
      }
}

The above javascript will inject the extra form field 'fp_upload_field' with the value of the FilePond file field name. And this works like a charm for us.

So is it possible to extend the view.py with an extra check for an extra field containing the file upload field name?

500 error if BASE_DIR not set

Hi I think that bugfix on issue #5 didn't solve the problem. Unless I'm doing something cardinally wrong.

        if ((not hasattr(local_settings, 'UPLOAD_TMP')) or
                (not (storage.location).startswith(local_settings.BASE_DIR))):
            return Response('The file upload path settings are not '
                            'configured correctly.',
                            status=status.HTTP_500_INTERNAL_SERVER_ERROR)

Check fails on not (storage.location).startswith(local_settings.BASE_DIR)

Debugger variables:
storage.location: /var/www/domain/proj_name/temp/filepond_uploads
local_settings.BASE_DIR: /var/www/domain/venv/lib/python3.6/site-packages/django_drf_filepond

Model Form validation with FilePond form.save()

Firstly, thankyou for developing django-drf-filepond. Its a life saver!
I am a lil confused as to how django-drf-filepond helps with form validation on post request. So i have set up everything and my files are uploaded to temporary folder. I want to know if my post request validation (that is form.save()) fails how do i keep track of uploaded files and let user fix errors with the parent form.

Check for PEP8 formatting in the CI pipeline

flake8 or a similar PEP8 formatting checker is not being run as part of the CI pipeline (at least it's definitely not being run on the code in /tests, this needs to be checked for the main code). The CI pipeline should be updated to include checking for code formatting.

Possible auth issues when using both SessionAuthentication and TokenAuthentication

As originally highlighted in #43, there are reports of issues when using using both SessionAuthentication and TokenAuthentication in 'DEFAULT_AUTHENTICATION_CLASSES'.

It's not clear whether this works in some circumstances because requests contain support for both authentication types and not in others where only the required headers/content are provided to support one auth type, or whether something else is going on.

This needs further investigation and the documentation will likely need updating to highlight this and provide guidance on avoiding the issue.

Add 'uploaded_by' field to TemporaryUpload and StoredUpload models

So I'm trying to associate somehow uploaded files with a user who does the uploading.

First I had an idea to do it via signals on my end and create a "bridge" model, which would link your models with mine. But I can't access the request and user from the model functionality.

Now if we had an optional ForeignKey field uploaded_by to Django "auth.user" that would make relation which would help a lot I think. If user is anonymous, then the field would be None.

Or I could just have another endpoint on my end which would be called from the client once your library replies with 200, which then in turn would create a record in my "bridge" model.

Would love to hear your thoughts :)

P.S. I'm happy to do the PR.

PEP8 formatting errors in test code

The code in tests/ includes a few cases where PEP8 formatting is not fully adhered to and flake8 generates warnings.

This has been fixed by @Incred in #87. Adding this corresponding issue for future tracking.

Fetch endpoint fails with Unsupported UTF-8 sequence length when encoding string

I'm not sure why, but my http://localhost/fp/fetch/?target=https%3A%2F%2Fcdn.cnn.com%2Fcnnnext%2Fdam%2Fassets%2F190410094953-india-waterfalls---athirappalli-waterfalls.jpg request gets OverflowError: Unsupported UTF-8 sequence length when encoding string error.

Full stack trace:

ERROR Internal Server Error: /fp/fetch/
Traceback (most recent call last):
  File "/var/www/proj_name/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/var/www/proj_name/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 156, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/var/www/proj_name/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 154, in _get_response
    response = response.render()
  File "/var/www/proj_name/venv/lib/python3.6/site-packages/django/template/response.py", line 106, in render
    self.content = self.rendered_content
  File "/var/www/proj_name/venv/lib/python3.6/site-packages/rest_framework/response.py", line 72, in rendered_content
    ret = renderer.render(self.data, accepted_media_type, context)
  File "/var/www/proj_name/venv/lib/python3.6/site-packages/drf_ujson/renderers.py", line 24, in render
    ret = ujson.dumps(data, ensure_ascii=self.ensure_ascii)
OverflowError: Unsupported UTF-8 sequence length when encoding string
ERROR "GET /fp/fetch/?target=https%3A%2F%2Fcdn.cnn.com%2Fcnnnext%2Fdam%2Fassets%2F190410094953-india-waterfalls---athirappalli-waterfalls.jpg HTTP/1.1" 500 114731

Add support for large files (>2 GB)

offset and total_size in bytes are currently represented by int32 fields in the database:

offset = models.IntegerField(default=0)

This effectively limits the max file size to roughly 2 GB.

In my use case, django-drf-filepond sometimes needs to be able to swallow/accept large files. It would be nice if django-drf-filepond could use BigIntegerField (64 bits) instead of IntegerField (32 bits).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.