Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.
You'll probably be working with a single smartcard, so you'll want only one primary key ( |
You'll probably be working with a single smartcard, so you'll want only one primary key ( |
import sys, os | |
local_path = lambda path: os.path.join(os.path.dirname(__file__), path) | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'PROJECTNAME.settings' | |
sys.path.append(local_path('..')) | |
... # Rest of conf.py goes here |
import base64 | |
from django.core.files.base import ContentFile | |
from rest_framework import serializers | |
class Base64ImageField(serializers.ImageField): | |
def from_native(self, data): | |
if isinstance(data, basestring) and data.startswith('data:image'): | |
# base64 encoded image - decode |
# Mostly from django-fab-deploy | |
import os | |
import sys | |
from datetime import datetime | |
from subprocess import Popen, PIPE | |
import yaml | |
from fabric.api import env, run, sudo, task |
package main | |
import ( | |
"database/sql" | |
"errors" | |
"fmt" | |
_ "github.com/bmizerany/pq" | |
"os" | |
"regexp" | |
"strings" |
>>> import pytz | |
>>> from datetime import datetime | |
>>> time_zone = pytz.timezone('Asia/Singapore') | |
>>> my_time = datetime.utcnow() | |
>>> my_time | |
datetime.datetime(2012, 9, 7, 12, 6, 15, 56631) | |
>>> my_time.replace(tzinfo=pytz.utc) | |
datetime.datetime(2012, 9, 7, 12, 6, 15, 56631, tzinfo=<UTC>) | |
>>> my_time = my_time.replace(tzinfo=pytz.utc) | |
>>> my_time.astimezone(time_zone) |