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 views import ApprovedStoryList, CreateStory | |
urlpatterns = patterns( | |
'', | |
url(r'^$', ApprovedStoryList.as_view(), name="index"), | |
url(r'^share/$', CreateStory.as_view(), name="share"), | |
) |
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 import template | |
from django.contrib.humanize.templatetags.humanize import intcomma, intword | |
import facebook | |
register = template.Library() | |
@register.simple_tag | |
def likes(current_site): |
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 ReverseProxied(object): | |
def __init__(self, app): | |
self.app = app | |
def __call__(self, environ, start_response): | |
script_name = environ.get('HTTP_X_SCRIPT_NAME', None) | |
if script_name is not None: | |
environ['SCRIPT_NAME'] = script_name | |
path_info = environ['PATH_INFO'] | |
if path_info.startswith(script_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 import template | |
from django.contrib.contenttypes.models import ContentType | |
from django.contrib.humanize.templatetags.humanize import intcomma, intword | |
from whereabouts.models import SocialNetworkProfile | |
import facebook | |
register = template.Library() |
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 | |
class Server(object): | |
def __init__(self, id, name, status, public_ip, private_ip): | |
self.id = id | |
self.name = name | |
self.status = status | |
self.public_ip = public_ip | |
self.private_ip = private_ip |
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" %} | |
{% block content %} | |
<form method="POST" action="{{ dest }}"> | |
<input type="hidden" name="confirm" value="no" /> | |
<input type="submit" value="No" /> | |
</form> | |
<form method="POST" action="{{ dest }}"> | |
<input type="hidden" name="confirm" value="yes" /> | |
<input type="submit" value="Yes" /> |
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
name: RabbitFish Documentation | |
description: Documentation for the RabbitFish static site generator. | |
pages: | |
- !Page | |
name: index | |
template: main.html | |
- !DynamicPage | |
name: features | |
template: main.html |
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 sys, os | |
sys.path.append('/usr/local/venvs/my_venv/') | |
sys.path.append('/usr/local/venvs/my_venv/my_project') | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'my_project.settings' |
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
server { | |
listen 80; | |
server_name example; | |
error_log /var/www/wordpress_blog/logs/nginx_error.log error; | |
root /var/www/wordpress_blog/public/; | |
try_files $uri @php; | |
location @php { | |
include fastcgi_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 flask import Flask, render_template, request | |
from urllib import unquote | |
app = Flask(__name__) | |
@app.route("/<slug>/") | |
def ekit_index(slug): | |
template = "%s/index.html" % slug | |
return render_template(template) |