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
import sys | |
from django.core import serializers | |
def migrate(model, dest_db, size=2000, start=0, old_db="default"): | |
""" | |
Migrate data from one database to another database in chunks | |
Args: |
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
import io | |
from django.core.files.storage import default_storage as storage | |
def save(self, *args, **kwargs): | |
super().save(*args, **kwargs) | |
img_read = storage.open(self.image.name, 'r') | |
img = Image.open(img_read) |
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
""" | |
Fix for some issues with the original code from Heroku: | |
https://devcenter.heroku.com/articles/s3-upload-python | |
This example is also designed for use with Django, not Flask as in the original. | |
""" | |
import base64 | |
import hashlib | |
import hmac |
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
# fetch the changes from the remote | |
git fetch origin | |
# show commit logs of changes | |
git log master..origin/master | |
# show diffs of changes | |
git diff master..origin/master | |
# apply the changes by merge.. |