Skip to content

Instantly share code, notes, and snippets.


laike9m laike9m

View GitHub Profile
with freeze_time(datetime.datetime(2016, 2, 10, tzinfo=pytz.timezone('US/Pacific'))):
from mymodule import date_manager
class _DateManager(object):
def __init__(self):
self._today ='US/Pacific'))
View 百度网盘加速(北京)
View pool_connections&
import requests
from requests.adapters import HTTPAdapter
from threading import Thread
import logging
logging.basicConfig(filename='out.txt', level=logging.DEBUG, filemode='w')
requests_log = logging.getLogger("requests.packages.urllib3")
requests_log.propagate = True
laike9m /
Last active Aug 29, 2015
Simple Djano cache system for function/class-based views with automatic key generation
#!/usr/bin/env python
# coding: utf-8
from asset.models import *
from common.models import *
from cost.models import *
from django.core.cache import cache
import inspect
from django.contrib.contenttypes.models import ContentType
from django.db.models.signals import pre_save, pre_delete