This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 0.637461] Write protecting the kernel text: 4232k | |
[ 0.637500] Write protecting the kernel read-only data: 1272k | |
[ 0.647427] random: systemd-tmpfile urandom read with 0 bits of entropy available | |
[ 0.650489] systemd-udevd[47]: starting version 212 | |
[ 0.653627] i8042: PNP: PS/2 Controller [PNP0303:PS2K] at 0x60,0x64 irq 1 | |
[ 0.653634] i8042: PNP: PS/2 appears to have AUX port disabled, if this is incorrect please boot with i8042.nopnp | |
[ 0.654699] i8042: Warning: Keylock active | |
[ 0.654847] serio: i8042 KBD port at 0x60,0x64 irq 1 | |
[ 0.660105] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0 | |
[ 0.679289] sdhci: Secure Digital Host Controller Interface driver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BaseTestClient is flask.testing.FlaskClient | |
class TestClient(BaseTestClient): | |
""" | |
Test Client. | |
""" | |
def __exit__(self, exc_type, exc_value, tb): | |
self.preserve_context = False | |
top = _request_ctx_stack.top |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def check(A, B, C, index): | |
totals = [0 for _ in xrange(index)] | |
for i in xrange(index - 1, -1, -1): | |
totals[i] += B[i] | |
if C[i] != -1: | |
totals[C[i]] += totals[i] | |
return all([totals[i] <= A[i] for i in xrange(index)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 %}]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Django settings for testsite project. | |
import os | |
ProjectDir = os.getcwd() | |
print 'ProjectDir', ProjectDir | |
DEBUG = True | |
TEMPLATE_DEBUG = DEBUG | |
ADMINS = ( |
OlderNewer