Skip to content

Instantly share code, notes, and snippets.

View ag-castro's full-sized avatar
🚀
Learn, Work & Help

Andre Gustavo Castro ag-castro

🚀
Learn, Work & Help
  • Web Apps Agency
  • Brazil
View GitHub Profile
@ag-castro
ag-castro / README-Template.md
Created January 30, 2019 01:02 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@ag-castro
ag-castro / image_validator.py
Created December 24, 2018 03:49
A validator image for Wagtail CMS
import os
from django.core.exceptions import ValidationError
from django.core.files.images import get_image_dimensions
from django.utils.deconstruct import deconstructible
from wagtail.images.models import Image # To get the image object from wagtail collections
@deconstructible
class ImageValidator:
"""ImageField dimensions validator."""