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 re | |
from django.conf import settings | |
from django.core import cache as django_cache | |
from mock import patch | |
from rest_framework.permissions import SAFE_METHODS | |
from rest_framework.response import Response | |
class CachedResourceMixin (object): | |
@property |
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 subprocess | |
import unittest | |
from scrapy.crawler import Crawler | |
from scrapy.utils.project import get_project_settings | |
from twisted.internet import reactor, task | |
from my_project.spiders.spider1 import Spider1 | |
from my_project.spiders.spider2 import Spider2 |
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 os | |
# here() gives us file paths from the root of the system to the directory | |
# holding the current file. | |
here = lambda * x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x) | |
PROJECT_ROOT = here("..") | |
# root() gives us file paths from the root of the system to whatever | |
# folder(s) we pass it starting at the parent directory of the current file. | |
root = lambda * x: os.path.join(os.path.abspath(PROJECT_ROOT), *x) |
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
To install node.js and coffee-script inside a virtualenv and keep it self-contained: | |
1. Activate the virtualenv:: | |
$ workon test | |
2. Move inside the virtualenv directory:: | |
(test)$ cdvirtualenv |
NewerOlder