Skip to content

Instantly share code, notes, and snippets.

frnhr /
Last active Oct 28, 2020 — forked from ObserverOfTime/
A form field to handle validation of image + svg, Django 3.1
from django.core import validators
from lxml import etree
from django.core.exceptions import ValidationError
from django.forms import ImageField
# monkeypatch allowed file extensions:
_original = validators.get_available_image_extensions
validators.get_available_image_extensions = lambda: _original() + ["svg"]
View gist:b9d597458c73c7a33f1bc18f0dc652e5
#taken from //
#the "forever" part taken from //
#thanks to [Ryan s]( and [Dave Stevens](
mkdir -p $HOME/src
cd $HOME/src
wget ''
tar -xzf node-v0.8.9.tar.gz
cd node-v0.8.9