Skip to main content

django-clamd is a django integration with Clamd (Clamav daemon).

Project description

This project integrates python-clamd with Django for easy scanning files for viruses on upload


>From PyPi with pip:

pip install django-clamd


easy_install django-clamd

You can also install development version direclty from GitHub:

pip install git+

Aditioanlly if you want translations to work you need to add it to installed apps.



You can use it in forms:

from django import forms
from django_clamd.validators import validate_file_infection

class UploadForm(forms.Form):
    upload_file = forms.FileField(validators=[validate_file_infection])

Or you can add it as validator directly in your model:

from django.db import models
from django_clamd.validators import validate_file_infection

class FileModel(models.Model):
    document = models.FileField(validators=[validate_file_infection])

You will have automatically scanning of upladed files in Django Admin and also when create ModelForm’s for that model.


By default django-clamd 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/clamd.ctl'

Note: When you are running on Fedora or CentOS and clamav-scanner package is installed then default value for CLAMD_SOCKET is:

CLAMD_SOCKET = '/var/run/clamd.scan/clamd.sock'

You also can disable virus scanning for development with:


Note: This is primary for make it easy to run a project on development without the need of installing Clamd on devlopment machine.


django-clamd is released as open-source software under the LGPL license.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-clamd, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size django_clamd-0.4.0-py2.py3-none-any.whl (11.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-clamd-0.4.0.tar.gz (5.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page