A Django validator that validates European VAT numbers
The full documentation is at https://django-vatno-validator.readthedocs.org.
Install vatno-validator:
pip install django-vatno-validator
Then use it in a project:
from django.db import models from vatno_validator.validators import VATNoValidator class MyModel(models.Model): vat_no = models.CharField(validators=[VATNoValidator(allowed_countries=[ 'DE', 'AT', 'GB', ])])
- Validates all 28 European member's VAT numbers according to http://ec.europa.eu/taxation_customs/vies/faq.html#item_11
- It does not actually query the VIES, it only performs a format-check
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install -r requirements-text.txt (myenv) $ python runtests.py
Tools used in rendering this package: