This document has now been incorporated into the uWSGI documentation:
http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
Steps with explanations to set up a server using:
from django.core.paginator import ObjectPaginator | |
class QuickObjectPaginator(ObjectPaginator): | |
max_safe_pages = 0 | |
def __init__(self, object_list, per_page, orphans=0, max_safe_pages=0): | |
self.max_safe_pages = max_safe_pages | |
super(QuickObjectPaginator, self).__init__(object_list, per_page, orphans) | |
def validate_page_number(self, page_number): |
"Memcached cache backend" | |
from django.core.cache.backends import memcached | |
from django.utils.encoding import smart_unicode, smart_str | |
MIN_COMPRESS_LEN = 150000 | |
class CacheClass(memcached.CacheClass): | |
def add(self, key, value, timeout=None, min_compress_len=MIN_COMPRESS_LEN): | |
if isinstance(value, unicode): |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
## based on http://pastie.org/private/bclbdgxzbkb1gs2jfqzehg | |
import sublime | |
import sublime_plugin | |
import subprocess | |
class PromptRunExternalCommand(sublime_plugin.WindowCommand): |
#!/usr/bin/env ruby | |
=begin | |
* Name: xml.rb | |
* Description parses xml iTunes Music Library and inserts into database | |
so other apps can use, rather than each time parsing xml file | |
* Author: Original - Aaron Patterson (xml parsing portion) | |
http://groups.google.com/group/nokogiri-talk/browse_thread/thread/97973521c6f5f0dc | |
* Additions by rkumar | |
* Date: 2010-08-04 | |
* License: |
/* create tables to store itunes music library data for quick access | |
- olifante 2013 January - added columns used by iTunes 11.0.1 | |
- rkumar 2010 July | |
*/ | |
-- drop table tracks; | |
create table tracks ( | |
album_artist VARCHAR(50), | |
album_rating_computed INTEGER, | |
album_rating INTEGER, | |
album VARCHAR(50), |
http://blip.tv/file/get/Richhickey-ClojureDataStructuresPart1411.flv | |
http://blip.tv/file/get/Richhickey-ClojureDataStructuresPart2306.flv | |
http://blip.tv/file/get/Richhickey-ClojureSequences733.flv | |
http://blip.tv/file/get/Richhickey-ClojureConcurrency252.flv | |
http://blip.tv/file/get/Richhickey-ClojureForJavaProgrammers2Of2680.mov | |
http://blip.tv/file/get/Richhickey-ClojureForJavaProgrammers1Of2174.flv | |
http://blip.tv/file/get/Richhickey-ClojureForLispProgrammersPart2299.mov | |
http://blip.tv/file/get/Richhickey-ClojureForLispProgrammersPart1372.flv | |
http://blip.tv/file/get/Richhickey-HammockdrivenDevelopment465.mov | |
http://blip.tv/file/get/Richhickey-MichaelFogusFertileGroundTheRootsOfClojure492.mov |
Upgrade Django from 1.1 to 1.5.1. This highlights some of the issues that one may encounter when updating Django. It's not possible to cover every case, but this should provide a good general starting point.
Django now supports multiple databases and changes are needed to how the database connections are defined.
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# ... or force ignoredups and ignorespace | |
HISTCONTROL=ignoredups:ignorespace |
if [ -f ~/.bashrc ]; then | |
source ~/.bashrc | |
fi |