Run the following command from
-
The root directory of Django project
-
The root directory of Django app
$ django-admin.py makemessages
or
$ django-admin.py makemessages -l fr # to update message file
'use strict' | |
// The helper | |
(function(self) { | |
//helper guts goes here :) | |
//data store for holding objects | |
var localStore = {}; |
java -Djava.library.path=/mnt/liting/jdk1.6.0_38/lib/ -jar minions.jar 9001 jedi004 9001 5 |
Modify /etc/sudoers | |
Defaults env_reset | |
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
from django.core.mail import EmailMultiAlternatives | |
from django.template.loader import render_to_string | |
from django.utils.html import strip_tags | |
subject, from_email, to = 'Order Confirmation', '[email protected]', '[email protected]' | |
html_content = render_to_string('the_template.html', {'varname':'value'}) # ... | |
text_content = strip_tags(html_content) # this strips the html, so people will have the text as well. | |
# create the email, and attach the HTML version as well. |
Steps to install PIL
$ sudo apt-get install python-imaging
$ sudo apt-get install libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev
$ sudo ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/
$ sudo ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/
$ sudo ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/
$ pip install PIL
#!/usr/bin/python | |
import subprocess | |
import time | |
cmd = 'python ./output.py' | |
proc = subprocess.Popen( | |
cmd, | |
shell=True, |
print 'AlbumID:', photo.albumid.text | |
print 'PhotoID:', photo.gphoto_id.text | |
if photo.exif.make and photo.exif.model: | |
camera = '%s %s' % (photo.exif.make.text, photo.exif.model.text) | |
else: | |
camera = 'unknown' | |
print 'Camera:', camera | |
print 'Content URL:', photo.content.src | |
print 'First Thumbnail:', photo.media.thumbnail[0].url |
var carouselLinks = [], | |
linksContainer = $('#links'), | |
baseUrl; | |
// Add the demo images as links with thumbnails to the page: | |
$.each(result.photos.photo, function (index, photo) { | |
baseUrl = 'http://farm' + photo.farm + '.static.flickr.com/' + | |
photo.server + '/' + photo.id + '_' + photo.secret; | |
$('<a/>') | |
.append($('<img>').prop('src', baseUrl + '_s.jpg')) | |
.prop('href', baseUrl + '_b.jpg') |
// test browser | |
var Sys = {}; | |
var ua = navigator.userAgent.toLowerCase(); | |
var s; | |
(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] : | |
(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] : | |
(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] : | |
(s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] : | |
(s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0; |