This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os, argparse, hashlib | |
| from datetime import datetime | |
| from PIL import Image, ExifTags | |
| from shutil import move | |
| def modification_date(filename): | |
| t = os.path.getmtime(filename) | |
| return datetime.fromtimestamp(t) | |
| def md5_for_file(f, block_size=2**20): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django import forms | |
| from django.forms.fields import MultiValueField | |
| import pytz | |
| # provided by django-timezone-field==0.4 | |
| from timezone_field import TimeZoneFormField | |
| class DatetimeTZWidget(forms.MultiWidget): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.core.files.storage import FileSystemStorage | |
| from slimit import minify | |
| class StaticFileStorageAndJSMinifier(FileSystemStorage): | |
| """ | |
| A storage backend to be used by the staticfiles app -- STATICFILES_STORAGE | |
| setting. This backend operates just as a normal filesystem storage backend | |
| except when it detects a javascript file. | |
| After a javascript file is saved, we reopen the file, minify the contents |
NewerOlder