Skip to content

Instantly share code, notes, and snippets.

  • The Manual of Detection - Jedediah Berry
  • The Half-Made World - Felix Gilman
  • Old Man's War (and sequals, if you like the first) - John Scalzi
  • Swamplandia! - Karen Russell
  • Ghostwritten - David Mitchel (and if you like that, basically everything else he's written besides Jacob de Zoot)
  • Never Let Me Go - Kazuo Ishiguro
  • Wind-up Bird Chronicle - Haruki Murakami
  • The Amazing Adventures of Kavalier & Clay - Michael Chabon
  • The Savage Detectives - Roberto Bolaño
  • A Visit From The Goon Squad - Jennifer Egan
@panuta
panuta / gist:3075882
Last active May 7, 2024 13:33
How to setup Django server with virtualenv on Ubuntu Server 12.04

Fix locale problem

Open file /etc/default/locale to add or change LC_ALL to the following

LC_ALL="en_US.UTF-8"

Then logout and login again.

Install necessary packages

@hughsaunders
hughsaunders / django_search_view.py
Created June 17, 2011 12:18
Search View using Julien Phalip's technique.
def search(request):
search_string=request.POST['search_string']
if re.match(r'^\s*$',search_string): return redirect('home')
results=[]
search_fields=('id','name')
equipment_models = \
[model for model in django.db.models.get_models() if\
model._meta.db_table.startswith("equipment_")]
for model in equipment_models:
query=halipsearch.get_query(search_string,search_fields)