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
| 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
| 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
| 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
| {% 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
| {% 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
| {% extends "base.html" %} | |
| {% load content_filters content_tags sekizai_tags testimonial_tags %} | |
| {% block page_title %}2nd amazing title tag!{% endblock %} | |
| {% block css %} | |
| <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> | |
| <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/affiliates/sem-landing-page/home.css" /> | |
| {% endblock %} |
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 index(request): | |
| ctx = {} | |
| ctx['page_name'] = 'index' | |
| ctx['pages'] = ['index'] | |
| latest_news = Article.objects.order_by('-date_created')[:3] | |
| ctx['latest_news'] = latest_news | |
| return simple_dtt(request, 'index.html', ctx) |
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
| <VirtualHost 000.000.000.000:80> | |
| ServerName brandname.com | |
| ServerAlias www.brandname.com | |
| DocumentRoot /path/to/htdocs | |
| ErrorLog /path/to/logs/error_log | |
| TransferLog /path/to/logs/access_log | |
| Alias /favicon.ico /path/to/favicon.ico | |
| Alias /django-media/ "/path/to/app/media/" | |
| Alias /static/ "/path/to/app/static/" |
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 httplib, urllib | |
| from django.utils import simplejson | |
| """ | |
| curl -s --insecure -H "X-PAYPAL-SECURITY-USERID: Your_API_username" | |
| -H "X-PAYPAL-SECURITY-PASSWORD: Your_API_password" | |
| -H "X-PAYPAL-SECURITY-SIGNATURE: Your_API_signature" | |
| -H "X-PAYPAL-REQUEST-DATA-FORMAT: NV" | |
| -H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV" |