Skip to content

Instantly share code, notes, and snippets.

Environment:
Request Method: GET
Request URL: http://192.168.44.128:8000/uk/
Django Version: 1.3
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
from django import template
from life.models import *
register = template.Library()
def get_text(parser, token):
print 'token:', token.contents
tag_name, element_id = token.split_contents()
return TranslatedTextNode(element_id, True)
@jakab922
jakab922 / lighttpd.conf
Created September 21, 2011 12:13
My lighttpd configuration
server.document-root = "/var/www/sites/test_project/"
server.modules = ("mod_rewrite", "mod_access", "mod_fastcgi", "mod_accesslog", "mod_alias")
accesslog.filename = "/var/log/lighttpd.log"
fastcgi.server = (
"testsite.fcgi" => (
"main" => (
"host" => "127.0.0.1",
"port" => 8080,
)
# views.py
def landlords(request, lang_code):
template_dict = generate_base_dict(lang_code, '/landlords/')
template_dict['previous_developments'] = [TestimonialDummy('/static/images/prev_dev_thumb1.jpg', 'Cadwell House, London SW13') for i in range(3)]
template_dict['three_element'] = [i for i in range(1,4)]
return render_to_response('pages/landlords.html', template_dict, context_instance = RequestContext(request))
@jakab922
jakab922 / gist:1250566
Created September 29, 2011 11:29
variable undefined
<script type="text/javascript" charset="utf-8">
var min_trans = '{% gettext searchboxes-form-min %}';
var max_trans = '{% gettext searchboxes-form-max %}';
var sale_type = 'R';
var sales_min_prices = [{% for num in sales_min_prices %}{{ num }}{% if not forloop.last %},{% endif %}{% endfor %}];
var sales_max_prices = [{% for num in sales_max_prices %}{{ num }}{% if not forloop.last %},{% endif %}{% endfor %}];
var rentals_min_prices = [{% for num in rentals_min_prices %}{{ num }}{% if not forloop.last %},{% endif %}{% endfor %}];
var rentals_max_prices = [{% for num in rentals_max_prices %}{{ num }}{% if not forloop.last %},{% endif %}{% endfor %}];
# Django settings for testsite project.
import os
ProjectDir = os.getcwd()
print 'ProjectDir', ProjectDir
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
#!/usr/bin/env python
from django.core.management import execute_manager
import imp
try:
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
sys.exit(1)
google.maps.event.addListener(marker, 'click', function() {
alert('bubba');
});
events {
worker_connections 1024;
use epoll;
}
http {
server {
listen 80;
server_name 127.0.0.1;
from base import Language, StaffMember, Faq, FaqTranslation, Testimonial, TestimonialTranslation, Address, Branch, CityPart, District
from cms import Page, ContentName, OneColumnRow, TwoColumnRow, ThreeColumnRow, EmptyRow, ThreePictureRow, FourPictureRow, RealMedia, TabbedMedia
from news import NewsLetterSubscription, NewsLetter, EmailAlert
from property import PropertyDescription, PropertyThumbnail, PropertyCoordinate, Property
from static_translation import TextElement, TextElementTranslation