This file contains hidden or 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
{% extends "base.html" %} | |
{% load content_filters content_tags sekizai_tags testimonial_tags %} | |
{% block css %} | |
<link rel="stylesheet" href="{{ STATIC_URL }}css/home.css"> | |
<!-- Google Analytics Content Experiment code --> | |
<script>function utmx_section(){}function utmx(){}(function(){var | |
k='#######',d=document,l=d.location,c=d.cookie; | |
if(l.search.indexOf('utm_expid='+k)>0)return; |
This file contains hidden or 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
{% load content_tags content_filters sekizai_tags %}<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
<head> | |
<title>{% block page_title %}{% endblock %}</title> | |
<meta name="description" content="{% block page_description %}{% endblock %}" /> | |
<meta name="keywords" content="{% block page_keywords %}{% endblock %}" /> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> | |
<meta name="rating" content="general" /> | |
<meta name="distribution" content="global" /> | |
<meta name="resource-type" content="document" /> |
This file contains hidden or 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 simple_dtt(request, template, extra_context): | |
expire_time = timedelta(days=90) | |
if 'pages' in extra_context: | |
pages = extra_context['pages'] | |
pages.append(extra_context['page_name']) | |
else: | |
pages = get_active(urls.urlpatterns, extra_context['page_name']) |
This file contains hidden or 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.conf.urls.defaults import * | |
from django.conf import settings | |
from django.views.generic.simple import redirect_to | |
from django.views.decorators.cache import cache_page | |
from apps.common.views import simple_dtt | |
# Uncomment the next two lines to enable the admin: | |
from django.contrib import admin | |
admin.autodiscover() |
This file contains hidden or 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
class SearchEngineReferrerMiddleware(object): | |
""" | |
Usage example: | |
============== | |
{% if request.session.search_engine %} | |
You searched for {{ request.session.search_term }} using {{ request.session.search_engine }}. | |
{% endif %} | |
""" | |
SEARCH_PARAMS = { |
This file contains hidden or 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
class Profile(models.Model): | |
PROFILE_STATUS = ( | |
('DECLINED', 'Declined'), | |
('APPROVED', 'Approved'), | |
('PENDING', 'Pending') | |
) | |
name = models.CharField(max_length=128) | |
title = models.CharField(max_length=128, blank=True, null=True) |
This file contains hidden or 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
import os | |
from datetime import timedelta, datetime | |
from subprocess import call | |
from django.db import models | |
from django_extensions.db.fields.encrypted import EncryptedCharField | |
from django.contrib.localflavor.us.models import PhoneNumberField | |
from django.contrib.localflavor.us.us_states import STATE_CHOICES | |
from django.contrib.auth.models import User | |
from django.core.urlresolvers import reverse |
This file contains hidden or 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
<table class="table table-striped table-bordered table-condensed"> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Email</th> | |
<th>Phone</th> | |
<th>Intake Status</th> | |
<th></th> | |
</tr> | |
</thead> |
This file contains hidden or 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 choose_state(request): | |
# try to auto find the city/state from IP address | |
geo_ip = GeoIP() | |
city_info = geo_ip.city('12.201.194.50') | |
if city_info is not None and 'city' in city_info and 'region' in city_info and 'dont_auto_crime_stats' not in request.session: | |
request.session['dont_auto_crime_stats'] = True | |
return HttpResponseRedirect(reverse('crime-rate:crime-stats', kwargs={'city': city_info['city'], 'state': city_info['region']})) | |
states = State.objects.order_by('name') | |
forms = {} |
This file contains hidden or 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
import os | |
from datetime import timedelta | |
from django.db import models | |
from django_extensions.db.fields.encrypted import EncryptedCharField | |
from django.contrib.localflavor.us.models import PhoneNumberField | |
from django.contrib.localflavor.us.us_states import STATE_CHOICES | |
from django.contrib.auth.models import User | |
from django.core.urlresolvers import reverse | |
from django.conf import settings |