Example #1
0
import json
import os
import re
from requests import get, post
from operator import itemgetter

from datetime import datetime
from base64 import b64encode

from flask import Flask, render_template, request, redirect, url_for, make_response, flash
import filters

app = Flask(__name__, static_url_path="/brigade/static")
app.register_blueprint(filters.blueprint)

app.config["BRIGADE_SIGNUP_SECRET"] = os.environ["BRIGADE_SIGNUP_SECRET"]
app.secret_key = "SECRET KEY"


@app.context_processor
def get_fragments():
    """ The base template includes the signup form and the footer
        pulled from our main site.
    """
    # Get universal sign up form
    r = get("http://www.codeforamerica.org/fragments/email-signup.html")
    signup = r.content

    # Get footer html
    r = get("http://www.codeforamerica.org/fragments/global-footer.html")
    footer = r.content