I want to know how to make static files show up when developing locally.
- Think of some search terms that might describe what you're looking for. Let's go with django static files runserver
$ python setup.py test | |
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'mantainer' | |
warnings.warn(msg) | |
running test | |
running egg_info | |
writing django_simple_history.egg-info/PKG-INFO | |
writing top-level names to django_simple_history.egg-info/top_level.txt | |
writing dependency_links to django_simple_history.egg-info/dependency_links.txt | |
reading manifest file 'django_simple_history.egg-info/SOURCES.txt' | |
reading manifest template 'MANIFEST.in' |
#!/usr/bin/env python | |
from unittest import TestCase, main | |
from turn_picker import score | |
class TurnPickerTest(TestCase): | |
def test_score_low_vs_high_attendance(self): | |
self.assertGreater(score(2, 10, 0), score(50, 200, 12)) |
>>> from time import mktime | |
>>> from datetime import datetime | |
>>> mktime(datetime(2038, 1, 18, 19, 14, 30).timetuple()) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
OverflowError: mktime argument out of range |
""" | |
Programming interview practice of the week (2013-02-20) | |
Problem of the week - Singletons considered okay | |
1. Write a simple singleton class in your favorite programming language with an example usage. | |
2. Solve the Sorted array binary search problem: | |
Given a sorted array of integers array and an integer key, return the index of the first instance of key in the array. If key is not present in array, you should return -1. |
#!/bin/sh | |
if which nmap > /dev/null ; then | |
echo "Running nmap as root\n" | |
IP_RANGE=$(ip addr | grep "inet " | awk '{ print $2}' | grep -v 127.0.0) | |
sudo nmap -sP $IP_RANGE | grep -B2 -i 'b8:27:eb\|80:1f:02' | |
else | |
if which arp-scan > /dev/null ; then | |
echo "Running arp-scan as root\n" | |
sudo arp-scan --interface=eth0 --localnet | grep 'b8:27:eb\|80:1f:02' | |
else |
run: | |
python manage.py runserver_plus || python manage.py runserver | |
shell: | |
python manage.py shell_plus || python manage.py shell |
"""File for testing OS path separators in Python | |
Execute this file like this: | |
python test_path.py c:/path/to/a/file.txt | |
""" | |
import sys | |
import os |
{ | |
"queue_status": "running", | |
"_embedded": { | |
"jobs": [ | |
{ | |
"_links": { | |
"self": { "href": "/queue/job1" }, | |
} | |
"status": "queued" | |
}, |