django-clamd
This project integrates python-clamd with Django for easy scanning files for viruses on upload
Install
>From PyPi with pip:
pip install django-clamdor
easy_install django-clamdYou can also install development version direclty from GitHub:
pip install git+www.cronistalascolonias.com.arAditioanlly if you want translations to work you need to add it to installed apps.
INSTALLED_APPS=('django_clamd',)Usage
You can use it in forms:
fromdjangoimportformsfromdjango_www.cronistalascolonias.com.artorsimportvalidate_file_infectionclassUploadForm(www.cronistalascolonias.com.ar):upload_file=www.cronistalascolonias.com.areld(validators=[validate_file_infection])Or you can add it as validator directly in your model:
www.cronistalascolonias.com.arrtmodelsfromdjango_www.cronistalascolonias.com.artorsimportvalidate_file_infectionclassFileModel(www.cronistalascolonias.com.ar):document=www.cronistalascolonias.com.areld(validators=[validate_file_infection])You will have automatically scanning of upladed files in Django Admin and also when create ModelForm’s for that model.
Configuration
By default tries to be smart and with good defaults. You can still configure how to connect to Clamd. Default values are:
CLAMD_SOCKET='/var/run/clamav/www.cronistalascolonias.com.ar'CLAMD_USE_TCP=FalseCLAMD_TCP_SOCKET=CLAMD_TCP_ADDR=''Note: When you are running on Fedora or CentOS and package is installed then default value for is:
CLAMD_SOCKET='/var/run/www.cronistalascolonias.com.ar'You also can disable virus scanning for development with:
CLAMD_ENABLED=FalseNote: This is primary for make it easy to run a project on development without the need of installing Clamd on devlopment machine.
License
django-clamd is released as open-source software under the LGPL license.
-
-
-