This file contains 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
* Remove all occurences of `# -*- coding: utf-8 -*-`. | |
* Remove all imports `unicode_literals`. | |
* Search for all occurences of `super(MyClass, self).` and replace by `super()`. **Check for grandparent super()!**. | |
* Search for all occurences of `six` and remove compatibility checks. | |
* Replace `ugettext` by `gettext`. | |
* Search for all occurences of `@python_2_unicode_compatible` and remove it. | |
* Search for all occurences of `__unicode__` and replace by `__str__`. | |
* Search for all occurences of `__nonzero__` and replace by `__bool__` | |
* Replace `from django.conf.urls import url` by `from django.urls import re_path`. | |
* Remove inheritance from `...(object)`. |
This file contains 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 reportlab.graphics import renderSVG | |
from svglib.svglib import svg2rlg | |
""" | |
The input file circle.svg contains this content: | |
<svg viewBox="0 0 300 300"> | |
<circle r="100" fill="red" transform="translate(150,150)"></circle> | |
<rect x="-25" y="-25" width="50" height="50" fill="green" transform="translate(150,150)"></rect> | |
</svg> | |
""" |
This file contains 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
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
import os | |
from django.conf import settings | |
from django.contrib.staticfiles.finders import FileSystemFinder | |
class ServeUnminimizedFinder(FileSystemFinder): | |
""" | |
In debug mode, serve /static/any/asset.min.ext as /static/any/asset.ext |