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 -*- | |
import logging | |
from threading import local | |
from django.contrib.auth.models import AnonymousUser | |
_thread_locals = local() | |
logger = logging.getLogger(__name__) |
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
# imports | |
import numpy as np | |
import cv2 | |
import matplotlib.pyplot as plt | |
# The Hough Transform is a popular algorithm for detecting any shape that can | |
# be represented in a parametric mathmatical form in binary images. This | |
# usually means that images need to be thresholded or filtered prior to running |
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 django.db import models | |
from django.utils import timezone | |
from django.contrib.auth.models import (AbstractBaseUser, | |
BaseUserManager as DjBaseUserManager) | |
from model_utils.managers import InheritanceManager | |
class BaseUserManager(DjBaseUserManager, InheritanceManager): | |
""" |
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 django.core.handlers.base import BaseHandler | |
from django.test.client import RequestFactory | |
class RequestMock(RequestFactory): | |
def request(self, **request): | |
"Construct a generic request object." | |
request = RequestFactory.request(self, **request) | |
handler = BaseHandler() | |
handler.load_middleware() | |
for middleware_method in handler._request_middleware: |