We have something like this set up at the moment; 2 repos (aws and github):
master
(aws)next
(aws)integation
(aws)master
(gh)next
(gh)integration
(gh)
# gunicorn.conf.py: getting gevent and psycogreen running | |
bind = '127.0.0.1:1437' | |
accesslog = "<some-path>/logs/gunicorn-access.log" | |
errorlog = "<some-path>/logs/gunicorn-error.log" | |
workers = 5 | |
try: | |
# fail 'successfully' if either of these modules aren't installed | |
from gevent import monkey | |
from psycogreen.gevent import patch_psycopg |
#!/bin/bash | |
if [[ ! -v SUPRNOVA_KEY ]] | |
then | |
echo -e "SUPRNOVA_KEY environment variable isn't set.\n\nThis should be the API key from your Suprnova account." | |
exit 1 | |
fi | |
if [[ ! -v SUPRNOVA_TARGET ]] | |
then | |
echo -e "SUPRNOVA_TARGET environment variable isn't set.\n\nThis should be 'zcl' if you are connecting to 'zcl.suprnova.cc'" |
# models.py | |
# the dev adds new fields to this as the client asks for more features | |
class ClientSettings(models.Model): | |
base_labour_rate = models.FloatField(...) | |
# middleware.py | |
class ClientSettingsMiddleware(object): | |
_settings = None |
0x9F7863A61e3A9E4746A650D02CbBE8F1b857f09d |
0x561E9A2d7cC2FfB8DcB098faD6d221d40dec509c |
from django import template | |
from users.forms import EmailSignupForm | |
register = template.Library() | |
@register.assignment_tag | |
def get_signup_form(): | |
return EmailSignupForm() |
{% extends "base.html" %} | |
{% load user_tags %} | |
{% block head-gace-js %} | |
// paste your Google Analytics Content Experiment JS code here if you're running an experiment. | |
{% endblock %} | |
{% block content %} | |
<h2>Awesome webpage content for businesses.</h2> | |
{% get_signup_form as signup_form %} |
{% extends "base.html" %} | |
{% block head-gace-js %} | |
// paste your Google Analytics Content Experiment JS code here if you're running an experiment. | |
{% endblock %} | |
{% block content %} | |
<h2>Awesome webpage content for businesses.</h2> | |
{% endblock %} |
{% load spurl %} | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
{# the `head-gace-js` block is what you would override in your original template to enable a Google Analytics Content Experiment #} | |
{% block head-gace-js %}{% endblock %} | |
{# by placing this canonical link in your base.html <head> section, all A/B template pages benefit - no duplicate content penalties #} |