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
/* Useful celery config. | |
app = Celery('tasks', | |
broker='redis://localhost:6379', | |
backend='redis://localhost:6379') | |
app.conf.update( | |
CELERY_TASK_RESULT_EXPIRES=3600, | |
CELERY_QUEUES=( | |
Queue('default', routing_key='tasks.#'), |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Copyright (c) 2013 Asumi Kamikaze Inc. | |
# Copyright (c) 2013 The Octopus Apps Inc. | |
# Licensed under the Apache License, Version 2.0 (the "License") | |
# Author: Alejandro M. Bernardis | |
# Email: alejandro.bernardis at gmail.com | |
# Created: 04/Oct/2013 09:37 | |
import urllib |
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 status_code_behavior(r): | |
""" | |
Holds a dictionary of all possible HTTP status codes and returns a string value. | |
:param code: HTTP Response status code | |
:return: {String} | |
""" | |
# Copied from multiple sources... | |
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Response_codes | |
# http://httpstatus.es/ |
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
<script> | |
var memFragConfig = { | |
force_desktop: true, | |
show_app_switcher: false, | |
headerContainer: 'header', // css class without '.' | |
mmdbHost: 'https://mmdb-staging.nationalgeographic.com', | |
memcenHost: 'https://membercenter-staging.nationalgeographic.com', |
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
<script> | |
var memFragConfig = { | |
force_desktop: true, | |
show_app_switcher: false, | |
headerContainer: 'header', // css class without '.' | |
mmdbHost: 'https://mmdb.nationalgeographic.com', | |
memcenHost: 'https://members.nationalgeographic.com', |
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 import settings | |
NGS_HEADER_DIV_CLASS = getattr(settings, 'NGS_HEADER_DIV_CLASS', 'header') | |
HEADER_ALERT_CONTAINER = getattr(settings, 'HEADER_ALERT_CONTAINER', '#dialog-alert') | |
EXTERNAL_MMDB_API_HOST = getattr(settings, 'EXTERNAL_MMDB_API_HOST', 'https://mmdb.nationalgeographic.com') | |
MEMBERCENTER_HOST = getattr(settings, 'MEMBERCENTER_HOST', 'https://members.nationalgeographic.com') | |
HEADER_STATIC_MEDIA = getattr(settings, 'HEADER_STATIC_MEDIA', '//assets.nationalgeographic.com/ngs-header/') |
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 json | |
import urllib2 | |
from django.http import HttpResponse | |
def send(request): | |
url = 'http://manage.encoding.com:80' | |
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
import json | |
import urllib2 | |
from django.http import HttpResponse | |
def send(request): | |
url = 'http://manage.encoding.com:80' | |
params = { |