In your command-line run the following commands:
brew doctor
brew update
#!/bin/bash | |
# This script will watch a given directory with a .git checkout and execute a deployment if it detects an update. | |
# You can set this up with CRON so that deployments happen automatically. | |
# | |
# Example CRON usage: | |
# crontab -e | |
# */5 * * * * bash /path/to/scripts/deploy.sh | |
# | |
# Example manual usage: | |
# bash /path/to/scripts/deploy.sh force |
In your command-line run the following commands:
brew doctor
brew update
import logging.config | |
import os | |
from django.utils.log import DEFAULT_LOGGING | |
# Disable Django's logging setup | |
LOGGING_CONFIG = None | |
LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper() | |
logging.config.dictConfig({ |
This Gist supplements article available at https://serafin.io/article/slack-django-errors | |
I've come to a point where I had to swap django's user model with a custom one, at a point when I already had users, and already had apps depending on the model. Therefore this guide is trying to provide the support that is not found in the django docs.
Django warns that this should only be done basically at the start of a project, so that the initial migration of an app includes the creation of the custom user model.
It took a while to do, and I ran into problems created by the already existing relations between other models and auth.User
.
There were good and not so good things regarding my project state, that influenced the difficulty of the job.
id
field, that's just a usual default django idimport cv2 | |
import numpy as np | |
from matplotlib import pyplot as plt | |
img = cv2.imread('image.jpg', cv2.IMREAD_GRAYSCALE) | |
def compute_skew(image): | |
image = cv2.bitwise_not(image) | |
height, width = image.shape |
Get Git log in JSON format
git log --pretty=format:'{%n "commit": "%H",%n "abbreviated_commit": "%h",%n "tree": "%T",%n "abbreviated_tree": "%t",%n "parent": "%P",%n "abbreviated_parent": "%p",%n "refs": "%D",%n "encoding": "%e",%n "subject": "%s",%n "sanitized_subject_line": "%f",%n "body": "%b",%n "commit_notes": "%N",%n "verification_flag": "%G?",%n "signer": "%GS",%n "signer_key": "%GK",%n "author": {%n "name": "%aN",%n "email": "%aE",%n "date": "%aD"%n },%n "commiter": {%n "name": "%cN",%n "email": "%cE",%n "date": "%cD"%n }%n},'
The only information that aren't fetched are:
%B
: raw body (unwrapped subject and body)%GG
: raw verification message from GPG for a signed commitTWITTER_CONSUMER_KEY="" | |
TWITTER_CONSUMER_SECRET="" | |
TWITTER_SEARCH_STRING="#tedc15 -rt" |
def AbstractClassWithoutFieldsNamed(cls, *excl): | |
""" | |
Removes unwanted fields from abstract base classes. | |
Usage:: | |
>>> from oscar.apps.address.abstract_models import AbstractBillingAddress | |
>>> from koe.meta import AbstractClassWithoutFieldsNamed as without | |
>>> class BillingAddress(without(AbstractBillingAddress, 'phone_number')): | |
... pass |