Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
django-uploader
Django Uploader uses jQuery file upload to allow drag-and-drop file upload of any file type in the Django Admin.
Readme
Django Uploader
Django Uploader uses jQuery file upload
_ to allow drag-and-drop file upload of any file type in the Django Admin. Third-party applications to write handlers for specific file types, and register them with Django Uploader. When a file of that type is uploaded, it passes the information to the handler so that it can make a new record with that file.
.. _jQuery file upload: https://blueimp.github.io/jQuery-File-Upload/
Installation is easy using pip
::
pip install django-uploader
Add uploader
to your INSTALLED_APPS
setting.
Add the uploader's urls::
url(r'^upload/', include('uploader.urls')),
Write one or more upload handlers.
Go to /admin/uploader/upload/ to start uploading.
.. note:: An upload handler does not have to exist within the application for which it creates records. It must simply be within an application that is imported so the handler can be discovered.
An upload handler assigns one or more MIME types to a function. There should only be one handler for a given MIME type, although Uploader does allow some overlap using '*'. For example, you can have one handler that handles image/tiff
and another that handles image/*
and yet another that handles */*
\ . The image/tiff
handler would get any .tiff
images, the image/*
would get any other type of image and the */*
handler would get any other type of file.
To start, create a file named upload.py
in your application. This file can contain several different handlers. When the Uploader application is first loaded, it attempts to import this file from every installed application.
A basic handler looks like this::
from uploader.registration import upload_handlers
def photo_handler(obj): """ Handle the creation of a SimpleModel record from an uploaded image. """ from .models import SimpleModel
new_item = SimpleModel.objects.create(
name=obj.filename,
slug=obj.filename_slug,
description='',
file=obj.file_contents
)
return new_item
photo_handler.thumbnail_attribute = 'thumb'
upload_handlers.register(['image/jpeg', 'image/png'], photo_handler)
FAQs
Django Uploader uses jQuery file upload to allow drag-and-drop file upload of any file type in the Django Admin.
We found that django-uploader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.